Phusion Passenger error

Hi All,

I am having an ROR application deployed on server, it is throwing the
following error on server when user uploads an image:

ActionController::RoutingError (No route matches
"/images/<image_name>.png" with {:method=>:get}):
passenger (2.2.15) lib/phusion_passenger/rack/request_handler.rb:92:in
`process_request'
  passenger (2.2.15)
lib/phusion_passenger/abstract_request_handler.rb:207:in `main_loop'
  passenger (2.2.15)
lib/phusion_passenger/railz/application_spawner.rb:441:in
`start_request_handler'
  passenger (2.2.15)
lib/phusion_passenger/railz/application_spawner.rb:381:in
`handle_spawn_application'
  passenger (2.2.15) lib/phusion_passenger/utils.rb:252:in `safe_fork'
  passenger (2.2.15)
lib/phusion_passenger/railz/application_spawner.rb:377:in
`handle_spawn_application'
  passenger (2.2.15) lib/phusion_passenger/abstract_server.rb:352:in
`__send__'
  passenger (2.2.15) lib/phusion_passenger/abstract_server.rb:352:in
`main_loop'
  passenger (2.2.15) lib/phusion_passenger/abstract_server.rb:196:in
`start_synchronously'
  passenger (2.2.15) lib/phusion_passenger/abstract_server.rb:163:in
`start'
  passenger (2.2.15)
lib/phusion_passenger/railz/application_spawner.rb:222:in `start'
  passenger (2.2.15) lib/phusion_passenger/spawn_manager.rb:253:in
`spawn_rails_application'
  passenger (2.2.15)
lib/phusion_passenger/abstract_server_collection.rb:126:in
`lookup_or_add'
  passenger (2.2.15) lib/phusion_passenger/spawn_manager.rb:247:in
`spawn_rails_application'
  passenger (2.2.15)
lib/phusion_passenger/abstract_server_collection.rb:80:in `synchronize'
  passenger (2.2.15)
lib/phusion_passenger/abstract_server_collection.rb:79:in `synchronize'
  passenger (2.2.15) lib/phusion_passenger/spawn_manager.rb:246:in
`spawn_rails_application'
  passenger (2.2.15) lib/phusion_passenger/spawn_manager.rb:145:in
`spawn_application'
  passenger (2.2.15) lib/phusion_passenger/spawn_manager.rb:278:in
`handle_spawn_application'
  passenger (2.2.15) lib/phusion_passenger/abstract_server.rb:352:in
`__send__'
  passenger (2.2.15) lib/phusion_passenger/abstract_server.rb:352:in
`main_loop'
  passenger (2.2.15) lib/phusion_passenger/abstract_server.rb:196:in
`start_synchronously'

Note: I am using attachment_fu for image uploading.

Anyone is having any solution on this??

Thanks

Saurabh

Saurabh Peshkar wrote:

Hi All,

I am having an ROR application deployed on server, it is throwing the
following error on server when user uploads an image:

ActionController::RoutingError (No route matches
"/images/<image_name>.png" with {:method=>:get})

Thanks

Saurabh

Hi Saurabh,
This error does not seem to be a passenger issue.
This is related to routes. Add proper route to environment.rb for
uploading of images.

Hope this solves your problem.

Thanks,
Anubhaw

Anubhaw Prakash wrote:

Saurabh Peshkar wrote:

Hi All,

I am having an ROR application deployed on server, it is throwing the
following error on server when user uploads an image:

ActionController::RoutingError (No route matches
"/images/<image_name>.png" with {:method=>:get})

Thanks

Saurabh

Hi Saurabh,
This error does not seem to be a passenger issue.
This is related to routes. Add proper route to environment.rb for

Add proper route to route.rb.

Thanks,
Anubhaw

Anubhaw Prakash wrote:

Anubhaw Prakash wrote:

Saurabh Peshkar wrote:

Hi All,

I am having an ROR application deployed on server, it is throwing the
following error on server when user uploads an image:

ActionController::RoutingError (No route matches
"/images/<image_name>.png" with {:method=>:get})

Thanks

Saurabh

Hi Saurabh,
This error does not seem to be a passenger issue.
This is related to routes. Add proper route to environment.rb for

Add proper route to route.rb.

Thanks,
Anubhaw

Hello Mr. Anubhaw Prakash,

I have tried it but still it is throwing the same error.

Thanks,

Saurabh

dont add a route for that, is in the public directory there is no need for that, everything static is server by the web server no by rails so creating a route in the route file makes no sense. Are you using capistrano and paperclip? in that case that is not the right path, capistrano updates the sym links on every release so everything that needs to be persistent has to be inside the public/system/
tell me your deployment environment to see if i can help.

radhames brito wrote:

dont add a route for that, is in the public directory there is no need
for
that, everything static is server by the web server no by rails so
creating
a route in the route file makes no sense. Are you using capistrano and
paperclip? in that case that is not the right path, capistrano updates
the
sym links on every release so everything that needs to be persistent has
to
be inside the public/system/
tell me your deployment environment to see if i can help.

Hi radhames,

I am using attachment_fu for image uploading. Images are getting created
in public/pictures/0000/0001/<image_name>

Thanks,

Saurabh

Are you sure the message is coming from the upload and not from the
action after the upload completes? Check your code to see what you do
after the upload (is it attempting to show the picture, using the
wrong path?) and have a look in the log file to get more clues.

Colin

Colin Law wrote:

OK, I was confused by the fact that you said the images were getting
created in public/pictures/0000/0001/<image_name>, but now you say
they are not getting saved at all.

Colin

What are you using to deploy ? are you using capistrano? and by the way paperclip is much better than attachment_fu

watch this screencast http://railscasts.com/episodes/134-paperclip , it is important to now is your are using capistrano(you should be!), and put a bit of your vew code when you present the pictures, i need to see some of th code to help.