开发者

rails 3.1 ActionController::RoutingError (No route matches [GET] "/assets/rails.png"):

开发者 https://www.devze.com 2023-03-29 03:52 出处:网络
Standard new rails app has issue showing the rails.png ActionController::RoutingError (No route matches [GET] \"/assets/rails.png\"):

Standard new rails app has issue showing the rails.png

ActionController::RoutingError (No route matches [GET] "/assets/rails.png"):

I have tried moving the .png file around to various places in assets and assets/images and also the older place 'public' or 'public/images' and changing the page but nothing has helped. Please answer if you have seen and resolved this. I have tried about 20 different combo's myself.

Version: 'rails', '3.1.0.rc4'开发者_如何学编程


I just had a problem throwing a similar error. In my case I was starting the rails server in production mode in Mac OSX using the standard WEBrick. It threw this error because of the line:

config.serve_static_assets = false

in config/environments/production.rb.

That is set because on most production machines the web server itself will handle this.

It looks like you were having a different problem, but I'll post this here for others that run into this error.


It must have been an rc4 issue as the final release didn't have this issue.

11/27/11 - I now wonder if this was just due to the asset pipeline that was introduced in rails 3.1, requiring the rake assets:precompile command (compiles and copies images, css and js from app/assets to public/.
If anyone finds that to be the case, please add a comment!

0

精彩评论

暂无评论...
验证码 换一张
取 消