Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

rails 3.1 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'

like image 914
Michael Durrant Avatar asked Aug 18 '11 11:08

Michael Durrant


2 Answers

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.

like image 73
tybro0103 Avatar answered Nov 09 '22 07:11

tybro0103


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!

like image 33
Michael Durrant Avatar answered Nov 09 '22 06:11

Michael Durrant