1
votes

I am taking the one month rails course and am stuck on having my images not appearing locally

I get the error msg: ActionController::RoutingError (No route matches [GET] "/images/medium/missing.png"):

I have paperclip 4.2.1 installed. Microsoft Window 8

I know that the problem is not due to there being no images in the folder. My images are being stored in this folder in the "Pinteresting" app folder:

pinteresting/public/system/pins/images/000/000/028

Within each "028" referencing the pin #28 folder there are three sub folders: (1)medium, (2) original, (3) thumb

Github link: https://github.com/pfeiffer101/pinteresting/commits/master

Here's the full message I see in the server

Started GET "/pins/27" for 127.0.0.1 at 2015-05-02 23:13:42 -0700
Processing by PinsController#show as HTML
Parameters: {"id"=>"27"}
Pin Load (1.0ms) SELECT "pins".* FROM "pins" WHERE "pins"."id" = 27 LIMIT 1
User Load (1.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = 1 ORDER BY "users"."id" ASC LIMIT 1
User Load (1.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1]]
Rendered pins/show.html.erb within layouts/application (9.0ms)
Rendered layouts/_header.html.erb (1.0ms)
Completed 200 OK in 280ms (Views: 274.0ms | ActiveRecord: 3.0ms)

Started GET "/images/medium/missing.png?1430525259" for 127.0.0.1 at 2015-05-02 23:13:42 -0700

ActionController::RoutingError (No route matches [GET] "/images/medium/missing.png"):
actionpack (4.1.8) lib/action_dispatch/middleware/debug_exceptions.rb:21:in call'
actionpack (4.1.8) lib/action_dispatch/middleware/show_exceptions.rb:30:incall'
railties (4.1.8) lib/rails/rack/logger.rb:38:in call_app'
railties (4.1.8) lib/rails/rack/logger.rb:20:inblock in call'
activesupport (4.1.8) lib/active_support/tagged_logging.rb:68:in block in tagged'
activesupport (4.1.8) lib/active_support/tagged_logging.rb:26:intagged'
activesupport (4.1.8) lib/active_support/tagged_logging.rb:68:in tagged'
railties (4.1.8) lib/rails/rack/logger.rb:20:incall'
actionpack (4.1.8) lib/action_dispatch/middleware/request_id.rb:21:in call'
rack (1.5.2) lib/rack/methodoverride.rb:21:incall'
rack (1.5.2) lib/rack/runtime.rb:17:in call'
activesupport (4.1.8) lib/active_support/cache/strategy/local_cache_middleware.rb:26:incall'
rack (1.5.2) lib/rack/lock.rb:17:in call'
actionpack (4.1.8) lib/action_dispatch/middleware/static.rb:84:incall'
rack (1.5.2) lib/rack/sendfile.rb:112:in call'
railties (4.1.8) lib/rails/engine.rb:514:incall'
railties (4.1.8) lib/rails/application.rb:144:in call'
rack (1.5.2) lib/rack/lock.rb:17:incall'
rack (1.5.2) lib/rack/content_length.rb:14:in call'
rack (1.5.2) lib/rack/handler/webrick.rb:60:inservice'
c:/RailsInstaller/Ruby2.1.0/lib/ruby/2.1.0/webrick/httpserver.rb:138:in service'
c:/RailsInstaller/Ruby2.1.0/lib/ruby/2.1.0/webrick/httpserver.rb:94:inrun'
c:/RailsInstaller/Ruby2.1.0/lib/ruby/2.1.0/webrick/server.rb:295:in `block in start_thread'

Rendered c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/actionpack-4.1.8/lib/action_dispatch/middleware/templates/rescues/_trace.html.erb (3.0ms)
Rendered c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/actionpack-4.1.8/lib/action_dispatch/middleware/templates/routes/_route.html.erb (6.0ms)
Rendered c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/actionpack-4.1.8/lib/action_dispatch/middleware/templates/routes/_table.html.erb (2.0ms)
Rendered c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/actionpack-4.1.8/lib/action_dispatch/middleware/templates/rescues/routing_error.html.erb within rescues/layout (96.0ms)
1

1 Answers

0
votes

Paperclip by default falls back to a missing.png image when you don't have the image object and yet call the url method, either change the default image, or add it to your public folder.