I recently tried upgrading my Rails 3.2.13 app to the newly released 4.0.0 and tried deploying it to Heroku. Unfortunately, despite following this guide, the assets still don't seem to precompile properly. Of course, I added the rails_12factor
gem already and I also did a couple of things to properly upgrade the app to 4.0.0. It works very nicely on development mode and all my tests are still passing. However, it still doesn't display the assets in Heroku.
One thing I noticed from running heroku run ls public/assets
is that Heroku was actually able to precompile the assets from app/assets
and doing a cat
command on those files will display the compiled version of the assets. However, if I access the file on the browser, I always get a 404.
Is Heroku actually ready for Rails 4?
EDIT:
Here's a list of things I did to upgrade from 3.2.13 to 4:
Removed asset group as it is no longer used in Rails 4
Update version of rails from
3.2.13
to4.0.0
Remove require line of
active_resource/railties
from application.rb since active_resource was removed as a dependency from railsUpdate sass-rails and coffee-rails to use their corresponding master branches because it is using railties 4.0.0.rc2 instead of 4.0.0 as the dependency
Update version of devise to 3.0.0.rc
Add protected_attributes to ease the transition to Rails 4 without having to switch to strong_parameters yet
Change environment configs to add config.eagerload and remove config.whiny_nils to remove deprecation warnings.
Change syntax of confirm() to remove deprecation warnings
Change hash syntax from hash rockets to the 1.9.3 syntax
Remove auto explain config to remove deprecation warnings
Add bin directory using rake rails:update:bin
Add
rails_12factor
gem to be able to host to herokuAdd ruby version in Gemfile for heroku
EDIT 2
I guess it's also worth mentioning that there wasn't any errors in Heroku during the precompilation and it actually says that it was successful in precompiling the assets which is why it's strange that it didn't work.
assets
group in Gemfile? This group is no longer used in Rails 4. – Mike Szyndelrake middleware
. Rack::Cache isn't being used. I tried creating a new Rails 4 app and deployed it to Heroku. For some reason, the assets are being compiled properly in the new app. I'll probably look at the differences between the two. – Terence Ponce