cubus / icheck-rails

icheck packaged for Rails asset pipeline
Other
32 stars 27 forks source link

404 (Not Found) error #5

Closed Jberczel closed 9 years ago

Jberczel commented 10 years ago

I'm able to use icheck-rails locally, but when I try to deploy to heroku I get this error when I try to use "square" and "pink" ichecks:

...assets/icheck/square/pink-c2b9dbc5fc0009e2ad993c63b28ba9cc.png 404 (Not Found)

The radio buttons do not appear on the form in production. It's probably a config issue on my side. But be grateful if you could point me in the right direction. I'm using ruby 2.1.2 and rails. 4.1.4.

mtarnovan commented 10 years ago

@Jberczel what version of the gem are you using? Can you reproduce the issue with the latest gem (1.2.0.1) ?

ricardodovalle commented 10 years ago

I also had same issue with Rails (4.14 and Ruby (2.1.2) on production mode. I don't know why, but I had to rename vendor folder to app folder to it works.

@Jberczel , you could try my personal repository, it works to me and it is equals to icheck-rails 1.2.0.1:

# Gemfile
gem 'icheck-rails',  github: 'ricardodovalle/icheck-rails'
mtarnovan commented 10 years ago

@ricardodovalle I didn't have time to test 1.2.0.1, but it should work. Can you confirm it works for you in production?

ricardodovalle commented 10 years ago

@mtarnovan It will work in production with Rails 4.1.4 if rename vendor to app. It is strange, I need to read more about asses precompile to understand why it is necessary.

Jberczel commented 10 years ago

@mtarnovan, I was using icheck-rails 1.2.0.1.

@ricardodovalle, Thanks for sharing your repo. icheck works in production when I use your repo. Nice workaround for the time being.

mtarnovan commented 10 years ago

@ricardodovalle Please let me know what you find out. I find it very strange that this problem persists after converting the stylesheets to scss and all asset references to image-url. I looked at the gems generated by rails-assets and they seem to use vendor/ too.

ricardodovalle commented 10 years ago

@mtarnovan

I found something about this issue here: https://github.com/rails-assets/rails-assets/issues/151

As an example, I've using vegas from rails-assets and It was necessary to add images files to initializers/assets.rb This way:

#assets.rb
Rails.application.config.assets.precompile += %w( vegas/dist/images/loading.gif )
Rails.application.config.assets.precompile += %w( vegas/dist/overlays/01.png )
mtarnovan commented 10 years ago

@ricardodovalle it might be that I never noticed this issues because I use this:

config.assets.precompile += %w(*.png *.jpg *.jpeg *.gif)

in my production.rb

ricardodovalle commented 9 years ago

Thanks @mtarnovan :+1:

I've added your suggestion to config/assets.rb and it solved.

Rails.application.config.assets.precompile += %w(*.png *.jpg *.jpeg *.gif)
mtarnovan commented 9 years ago

Glad I could help.