简体   繁体   中英

Why the stylesheet link path changed when I deploy the rails app to Heroku?

So in my localhost the stylesheet application.css is referenced as /assets/application.css and everything is fine, but when I deployed the app to Heroku, the css file is requested at the location /stylesheets/application.css . Is there something I didn't config right? I am just using stylesheet_link_tag "applicaiton" in my code. Update, I actually got:

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

How does this happen, the file is right there.

I think you might not have the right stack on Heroku. You current stack doesn't support rails 3.1 and doesn't support Assets pipeline either.

To fix this you would need to switch to the Cedar stack: http://devcenter.heroku.com/articles/stack

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