Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Asset routing error on Heroku after Rails 4 update

I just updated my app to Rails 4.0.0.beta1 and Ruby 2.0.0. It's a fairly simple app and the update went smoothly in development but when I deployed to Heroku I am getting a routing error on the precompiled assets.

ActionController::RoutingError (No route matches [GET] "/assets/application-ec10cb548646d3f1c9963e6071fd834f.css"):

and

ActionController::RoutingError (No route matches [GET] "/assets/application-f6ecf7845034937996ac1e966af347b9.js"):

Can anyone point me in the right direction?

like image 347
SteveO7 Avatar asked Mar 28 '13 19:03

SteveO7


2 Answers

If you followed this guide (Getting Started with Rails 4.x on Heroku) before yesterday afternoon (2013-03-27), then you likely need to change your Gemfile from:

group :heroku do
  gem 'rails_log_stdout',           github: 'heroku/rails_log_stdout'
  gem 'rails3_serve_static_assets', github: 'heroku/rails3_serve_static_assets'
end

to simply:

gem 'rails_log_stdout',           github: 'heroku/rails_log_stdout'
gem 'rails3_serve_static_assets', github: 'heroku/rails3_serve_static_assets'

Optionally, switch :heroku for :production.

like image 103
catsby Avatar answered Oct 20 '22 23:10

catsby


I believe this solution has been updated, and Heroku has replaced rails_log_stdout and rails3_serve_static_assets with rails_12factor. See here.

Now, you should put this in your GemFile:

gem 'rails_12factor', group: :production

Then run bundle install and git push heroku.

like image 27
Aaron Gray Avatar answered Oct 20 '22 22:10

Aaron Gray