简体   繁体   中英

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?

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 .

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 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM