small medium large xlarge

Generic-user-small
11 May 2009, 18:01
Ken Burgett (22 posts)

I completed the Depot demo app through Chapter 12 (I did not work on I18n yet) and everything seemed to work fine. I shut down for the day and came back the next day, ran ‘ruby script/server’ and entered ‘http://localhost:3000/store’ in my browser. I immediately noticed that the stylesheet was somehow broken, since the browser display was white (not green) and there were no icons for the 3 book products. I checked the mongrel display and saw this:

ActionController::RoutingError (No route matches “/images/auto.jpg” with {:method=>:get}): /home/kenb/ruby/gems/gems/actionpack-2.3.2/lib/action_controller/routing/recognition_optimisation.rb:66:in recognize_path' /home/kenb/ruby/gems/gems/actionpack-2.3.2/lib/action_controller/routing/route_set.rb:437:in recognize’ /home/kenb/ruby/gems/gems/actionpack-2.3.2/lib/action_controller/routing/route_set.rb:432:in call' /home/kenb/ruby/gems/gems/actionpack-2.3.2/lib/action_controller/dispatcher.rb:88:in dispatch’ /home/kenb/ruby/gems/gems/actionpack-2.3.2/lib/action_controller/dispatcher.rb:111:in _call' /home/kenb/ruby/gems/gems/actionpack-2.3.2/lib/action_controller/dispatcher.rb:82:in initialize’ /home/kenb/ruby/gems/gems/actionpack-2.3.2/lib/action_controller/vendor/rack-1.0/rack/head.rb:9:in call' /home/kenb/ruby/gems/gems/actionpack-2.3.2/lib/action_controller/vendor/rack-1.0/rack/head.rb:9:in call’ /home/kenb/ruby/gems/gems/actionpack-2.3.2/lib/action_controller/vendor/rack-1.0/rack/methodoverride.rb:24:in call' /home/kenb/ruby/gems/gems/actionpack-2.3.2/lib/action_controller/params_parser.rb:15:in call’ /home/kenb/ruby/gems/gems/actionpack-2.3.2/lib/action_controller/rewindable_input.rb:25:in call' /home/kenb/ruby/gems/gems/actionpack-2.3.2/lib/action_controller/session/abstract_store.rb:122:in call’ /home/kenb/ruby/gems/gems/activerecord-2.3.2/lib/active_record/query_cache.rb:29:in call' /home/kenb/ruby/gems/gems/activerecord-2.3.2/lib/active_record/connection_adapters/abstract/query_cache.rb:34:in cache’ /home/kenb/ruby/gems/gems/activerecord-2.3.2/lib/active_record/query_cache.rb:9:in cache' /home/kenb/ruby/gems/gems/activerecord-2.3.2/lib/active_record/query_cache.rb:28:in call’ /home/kenb/ruby/gems/gems/activerecord-2.3.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:361:in call' /home/kenb/ruby/gems/gems/actionpack-2.3.2/lib/action_controller/reloader.rb:9:in call’ /home/kenb/ruby/gems/gems/actionpack-2.3.2/lib/action_controller/failsafe.rb:11:in call' /home/kenb/ruby/gems/gems/actionpack-2.3.2/lib/action_controller/vendor/rack-1.0/rack/lock.rb:11:in call’ /home/kenb/ruby/gems/gems/actionpack-2.3.2/lib/action_controller/vendor/rack-1.0/rack/lock.rb:11:in synchronize' /home/kenb/ruby/gems/gems/actionpack-2.3.2/lib/action_controller/vendor/rack-1.0/rack/lock.rb:11:in call’ /home/kenb/ruby/gems/gems/actionpack-2.3.2/lib/action_controller/dispatcher.rb:106:in call' /home/kenb/ruby/gems/gems/rails-2.3.2/lib/rails/rack/static.rb:31:in call’ /home/kenb/ruby/gems/gems/actionpack-2.3.2/lib/action_controller/vendor/rack-1.0/rack/urlmap.rb:46:in call' /home/kenb/ruby/gems/gems/actionpack-2.3.2/lib/action_controller/vendor/rack-1.0/rack/urlmap.rb:40:in each’ /home/kenb/ruby/gems/gems/actionpack-2.3.2/lib/action_controller/vendor/rack-1.0/rack/urlmap.rb:40:in call' /home/kenb/ruby/gems/gems/rails-2.3.2/lib/rails/rack/debugger.rb:17:in call’ /home/kenb/ruby/gems/gems/rails-2.3.2/lib/rails/rack/log_tailer.rb:17:in call' /home/kenb/ruby/gems/gems/actionpack-2.3.2/lib/action_controller/vendor/rack-1.0/rack/content_length.rb:13:in call’ /home/kenb/ruby/gems/gems/actionpack-2.3.2/lib/action_controller/vendor/rack-1.0/rack/chunked.rb:15:in call' /home/kenb/ruby/gems/gems/actionpack-2.3.2/lib/action_controller/vendor/rack-1.0/rack/handler/mongrel.rb:61:in process’ /home/kenb/ruby/gems/gems/actionpack-2.3.2/lib/action_controller/vendor/rack-1.0/rack/handler/mongrel.rb:34:in `run’ /home/kenb/ruby/gems/gems/rails-2.3.2/lib/commands/server.rb:111

Does anyone know what this stack trace is all about? I searched the forums and have seen many references to bad routes, so maybe there is something broken in Rails? It seems silly to get a route error concerning a file sitting in the file system. Is the cache getting corrupted?

I am running version 2.3.2 of Rails.

Generic-user-small
27 Mar 2011, 16:34
Bala Paranj (20 posts)

I had the same problem with a Rails 3.0 project. I was accessing images in images/icons directory but the icons directory was under public folder. Once I moved the folder into images, it started working.

1) Test with a simple image_tag(“rails.png”). Does this work? 2) Check your directory structure and make sure it is correct.

You must be logged in to comment