Rails routing error. Application doesn't run - ruby-on-rails

Heyy guys, please help me. I am from 4 days on dreamhost setting up rails. Finally rails has started working but application is not running. I have just deployed a demo app with only one model Products and the page doesn't opens, it says page doesn't exist. There is written routing error in production log file. I am novice in Rails so could'nt figure out what is going wrong. You can try yourself running app http://meropati.com/products and see source code of this app with log files on my git repository *https://github.com/getaasciesh/TestingRailsOnDreamHost*
I will be so thankful to get it's solution.
Started GET "/products" for 208.113.229.116 at 2012-07-26 16:05:55 -0700
ActionController::RoutingError (No route matches [GET] "/products"):
actionpack (3.2.6) lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'
actionpack (3.2.6) lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
railties (3.2.6) lib/rails/rack/logger.rb:26:in `call_app'
railties (3.2.6) lib/rails/rack/logger.rb:16:in `call'
actionpack (3.2.6) lib/action_dispatch/middleware/request_id.rb:22:in `call'
rack (1.4.1) lib/rack/methodoverride.rb:21:in `call'
rack (1.4.1) lib/rack/runtime.rb:17:in `call'
activesupport (3.2.6) lib/active_support/cache/strategy/local_cache.rb:72:in `call'
rack (1.4.1) lib/rack/lock.rb:15:in `call'
rack-cache (1.2) lib/rack/cache/context.rb:136:in `forward'
rack-cache (1.2) lib/rack/cache/context.rb:245:in `fetch'
rack-cache (1.2) lib/rack/cache/context.rb:185:in `lookup'
rack-cache (1.2) lib/rack/cache/context.rb:66:in `call!'
rack-cache (1.2) lib/rack/cache/context.rb:51:in `call'
railties (3.2.6) lib/rails/engine.rb:479:in `call'
railties (3.2.6) lib/rails/application.rb:220:in `call'
railties (3.2.6) lib/rails/railtie/configurable.rb:30:in `method_missing'
/home/getaasciesh3/.passenger/standalone/3.0.14-x86_64-ruby1.9.3-linux-gcc4.4.5-1002/support/lib/phusion_passenger/rack/request_handler.rb:96:in `process_request'
/home/getaasciesh3/.passenger/standalone/3.0.14-x86_64-ruby1.9.3-linux-gcc4.4.5-1002/support/lib/phusion_passenger/abstract_request_handler.rb:516:in `accept_and_process_next_request'
/home/getaasciesh3/.passenger/standalone/3.0.14-x86_64-ruby1.9.3-linux-gcc4.4.5-1002/support/lib/phusion_passenger/abstract_request_handler.rb:274:in `main_loop'
/home/getaasciesh3/.passenger/standalone/3.0.14-x86_64-ruby1.9.3-linux-gcc4.4.5-1002/support/lib/phusion_passenger/rack/application_spawner.rb:206:in `start_request_handler'
/home/getaasciesh3/.passenger/standalone/3.0.14-x86_64-ruby1.9.3-linux-gcc4.4.5-1002/support/lib/phusion_passenger/rack/application_spawner.rb:171:in `block in handle_spawn_application'
/home/getaasciesh3/.passenger/standalone/3.0.14-x86_64-ruby1.9.3-linux-gcc4.4.5-1002/support/lib/phusion_passenger/utils.rb:470:in `safe_fork'
/home/getaasciesh3/.passenger/standalone/3.0.14-x86_64-ruby1.9.3-linux-gcc4.4.5-1002/support/lib/phusion_passenger/rack/application_spawner.rb:166:in `handle_spawn_application'
/home/getaasciesh3/.passenger/standalone/3.0.14-x86_64-ruby1.9.3-linux-gcc4.4.5-1002/support/lib/phusion_passenger/abstract_server.rb:357:in `server_main_loop'
/home/getaasciesh3/.passenger/standalone/3.0.14-x86_64-ruby1.9.3-linux-gcc4.4.5-1002/support/lib/phusion_passenger/abstract_server.rb:206:in `start_synchronously'
/home/getaasciesh3/.passenger/standalone/3.0.14-x86_64-ruby1.9.3-linux-gcc4.4.5-1002/support/lib/phusion_passenger/abstract_server.rb:180:in `start'
/home/getaasciesh3/.passenger/standalone/3.0.14-x86_64-ruby1.9.3-linux-gcc4.4.5-1002/support/lib/phusion_passenger/rack/application_spawner.rb:129:in `start'
/home/getaasciesh3/.passenger/standalone/3.0.14-x86_64-ruby1.9.3-linux-gcc4.4.5-1002/support/lib/phusion_passenger/spawn_manager.rb:253:in `block (2 levels) in spawn_rack_application'
/home/getaasciesh3/.passenger/standalone/3.0.14-x86_64-ruby1.9.3-linux-gcc4.4.5-1002/support/lib/phusion_passenger/abstract_server_collection.rb:132:in `lookup_or_add'
/home/getaasciesh3/.passenger/standalone/3.0.14-x86_64-ruby1.9.3-linux-gcc4.4.5-1002/support/lib/phusion_passenger/spawn_manager.rb:246:in `block in spawn_rack_application'
/home/getaasciesh3/.passenger/standalone/3.0.14-x86_64-ruby1.9.3-linux-gcc4.4.5-1002/support/lib/phusion_passenger/abstract_server_collection.rb:82:in `block in synchronize'
<internal:prelude>:10:in `synchronize'
/home/getaasciesh3/.passenger/standalone/3.0.14-x86_64-ruby1.9.3-linux-gcc4.4.5-1002/support/lib/phusion_passenger/abstract_server_collection.rb:79:in `synchronize'
/home/getaasciesh3/.passenger/standalone/3.0.14-x86_64-ruby1.9.3-linux-gcc4.4.5-1002/support/lib/phusion_passenger/spawn_manager.rb:244:in `spawn_rack_application'
/home/getaasciesh3/.passenger/standalone/3.0.14-x86_64-ruby1.9.3-linux-gcc4.4.5-1002/support/lib/phusion_passenger/spawn_manager.rb:137:in `spawn_application'
/home/getaasciesh3/.passenger/standalone/3.0.14-x86_64-ruby1.9.3-linux-gcc4.4.5-1002/support/lib/phusion_passenger/spawn_manager.rb:275:in `handle_spawn_application'
/home/getaasciesh3/.passenger/standalone/3.0.14-x86_64-ruby1.9.3-linux-gcc4.4.5-1002/support/lib/phusion_passenger/abstract_server.rb:357:in `server_main_loop'
/home/getaasciesh3/.passenger/standalone/3.0.14-x86_64-ruby1.9.3-linux-gcc4.4.5-1002/support/lib/phusion_passenger/abstract_server.rb:206:in `start_synchronously'
/home/getaasciesh3/.passenger/standalone/3.0.14-x86_64-ruby1.9.3-linux-gcc4.4.5-1002/support/helper-scripts/passenger-spawn-server:99:in `<main>'

This might not matter, but you've got:
gem 'sqlite3'
group :development, :test do
gem 'sqlite3'
end
...
gem 'mysql2'
Try removing the first reference to sqlite3 as you don't want it in production.
As I said, it might not make any difference to this particular issue, but it will save you from trouble later on
Update
The dreamhost wiki advise against using passenger and rvm, as they don't play too nicely together. Read the section titled "Troubleshooting". They recommend switching to the system installation of ruby.
If you are going to try that, you will probably need to remove the reference to rvm from environment.rb
Good luck

Related

How is config.assets.debug causing my Rails application to crash?

I've included the arbor-rails gem in my Rails 3.2.8 application and it works fine in development mode, but in production I get the following error:
Started GET "/nullarbor.js" for 127.0.0.1 at 2012-09-20 15:35:23 -0700
ActionController::RoutingError (No route matches [GET] "/nullarbor.js"):
actionpack (3.2.8) lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'
actionpack (3.2.8) lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
railties (3.2.8) lib/rails/rack/logger.rb:26:in `call_app'
railties (3.2.8) lib/rails/rack/logger.rb:16:in `call'
actionpack (3.2.8) lib/action_dispatch/middleware/request_id.rb:22:in `call'
rack (1.4.1) lib/rack/methodoverride.rb:21:in `call'
rack (1.4.1) lib/rack/runtime.rb:17:in `call'
activesupport (3.2.8) lib/active_support/cache/strategy/local_cache.rb:72:in `call'
rack (1.4.1) lib/rack/lock.rb:15:in `call'
actionpack (3.2.8) lib/action_dispatch/middleware/static.rb:62:in `call'
railties (3.2.8) lib/rails/engine.rb:479:in `call'
railties (3.2.8) lib/rails/application.rb:223:in `call'
rack (1.4.1) lib/rack/content_length.rb:14:in `call'
railties (3.2.8) lib/rails/rack/log_tailer.rb:17:in `call'
thin (1.4.1) lib/thin/connection.rb:80:in `block in pre_process'
thin (1.4.1) lib/thin/connection.rb:78:in `catch'
thin (1.4.1) lib/thin/connection.rb:78:in `pre_process'
thin (1.4.1) lib/thin/connection.rb:53:in `process'
thin (1.4.1) lib/thin/connection.rb:38:in `receive_data'
eventmachine (1.0.0) lib/eventmachine.rb:187:in `run_machine'
eventmachine (1.0.0) lib/eventmachine.rb:187:in `run'
thin (1.4.1) lib/thin/backends/base.rb:63:in `start'
thin (1.4.1) lib/thin/server.rb:159:in `start'
rack (1.4.1) lib/rack/handler/thin.rb:13:in `run'
rack (1.4.1) lib/rack/server.rb:265:in `start'
railties (3.2.8) lib/rails/commands/server.rb:70:in `start'
railties (3.2.8) lib/rails/commands.rb:55:in `block in <top (required)>'
railties (3.2.8) lib/rails/commands.rb:50:in `tap'
railties (3.2.8) lib/rails/commands.rb:50:in `<top (required)>'
script/rails:6:in `require'
script/rails:6:in `<main>'
I've gone through the settings in environments/ and discovered that when I set the following in development.rb:
config.assets.debug = false
I get the error in dev mode, too. And when I set it to true in production it works properly. What could be causing this?
Update: It seems to actually be something to do with the arbor_path function in arbor.js.
arbor.js uses a web worker which means that you need to provide the Worker creation with the appropriate link to where the arbor.js script will be.
What you could do to solve this problem is to provide the absolute path to your arbor.js file instead of letting the code use the arbor_path function that can be messed up by your caching logic or the way you serve js files.
In other words, try to replace
i=new Worker(arbor_path()+"arbor.js");
with
i=new Worker("/final/path/to/arbor.js");
in arbor.js
As #Asimov4 stated, the problem is produced on the following call:
new Worker(arbor_path()+"arbor.js");
Nonetheless, a more elegant solution, compatible with the precompilation of assets, is to change it to:
new Worker("<%= asset_path('arbor.js') %>");
Note: Remember to change the .js file to .js.erb!

ActionController::RoutingError No route matches [GET] "/stories"

OS: openSUSE 11.4
Rails 3.2.0
I just created a very simple application "koko". Here are the order of commands I ran
rails new koko
rails generate model Story name:string description:string
rake db:migrate
rails generate controller Stories index
All above commands executed successfully.
I then ran =>rails server to start the server.
localhost:3000/ works fine.
When i try to do
localhost:3000/stores I get the following error: (the browser displayes the first line about No route matches)
Started GET "/stories" for 127.0.0.1 at Sat Aug 04 12:52:02 -0400 2012
ActionController::RoutingError (No route matches [GET] "/stories"):
actionpack (3.2.0) lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'
actionpack (3.2.0) lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
railties (3.2.0) lib/rails/rack/logger.rb:26:in `call_app'
railties (3.2.0) lib/rails/rack/logger.rb:16:in `call'
actionpack (3.2.0) lib/action_dispatch/middleware/request_id.rb:22:in `call'
rack (1.4.1) lib/rack/methodoverride.rb:21:in `call'
rack (1.4.1) lib/rack/runtime.rb:17:in `call'
activesupport (3.2.0) lib/active_support/cache/strategy/local_cache.rb:72:in `call'
rack (1.4.1) lib/rack/lock.rb:15:in `call'
actionpack (3.2.0) lib/action_dispatch/middleware/static.rb:53:in `call'
railties (3.2.0) lib/rails/engine.rb:479:in `call'
railties (3.2.0) lib/rails/application.rb:220:in `call'
rack (1.4.1) lib/rack/content_length.rb:14:in `call'
railties (3.2.0) lib/rails/rack/log_tailer.rb:14:in `call'
rack (1.4.1) lib/rack/handler/webrick.rb:59:in `service'
/usr/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
/usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
/usr/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:95:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `each'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:23:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:82:in `start'
rack (1.4.1) lib/rack/handler/webrick.rb:13:in `run'
rack (1.4.1) lib/rack/server.rb:265:in `start'
railties (3.2.0) lib/rails/commands/server.rb:70:in `start'
railties (3.2.0) lib/rails/commands.rb:55
railties (3.2.0) lib/rails/commands.rb:50:in `tap'
railties (3.2.0) lib/rails/commands.rb:50
script/rails:6:in `require'
script/rails:6
Rendered /usr/lib/ruby/gems/1.8/gems/actionpack-3.2.0/lib/action_dispatch/middleware/templates/rescues/routing_error.erb within rescues/layout (0.9ms)
Your issue is that you are trying to use a RESTful interface to a non-RESTful resource. You made a model, and you made a controller with an index action, (/controller_name/action).
If you are happy with using /stories/index, then we're done! If you prefer the more traditional RESTful interface /stories, then I would suggest using:
rails generate resource ModelName fields:types.
This will create a Model and a Controller, and should work restfully out of the box. This will set up the route that was mentioned in the comments.
Hope this helps!
You might simply have some naming problems. Generally, when creating a controller it should be
rails g controller stories index
or
rails g controller Story index
Then change your automatically-generated route to
match "/stories" => "stories#index", :as => "stories"

refinerycms image not loading - dragonfly error

I'm working on developing a refinerycms rails app that was working good locally and now i've moved it to my VPS and I was having issues with images that i uploaded through refinerycms not loading and i've been reading that i needed to upgrade my version of imagemagick. I upgraded from 6.2.8 to 6.7.8. Now the images all load on some pages, but not on the admin side.
What is causing this issue? Here's the stacktrace of the error.
Dragonfly::Shell::CommandFailed (Command failed (convert '/var/www/vhosts/tomstestsite.us/PersonalTrainingKT/public/system/refinery/images/2012/06/03/16_36_48_339_pamLemke_after.jpg' '-resize' '225x255>' '/tmp/dragonfly20120705-7812-1xb3pce') with exit status 127):
dragonfly (0.9.12) lib/dragonfly/shell.rb:29:in `raise_shell_command_failed'
dragonfly (0.9.12) lib/dragonfly/shell.rb:23:in `run'
dragonfly (0.9.12) lib/dragonfly/image_magick/utils.rb:17:in `convert'
dragonfly (0.9.12) lib/dragonfly/image_magick/processor.rb:103:in `convert'
dragonfly (0.9.12) lib/dragonfly/image_magick/processor.rb:27:in `resize'
dragonfly (0.9.12) lib/dragonfly/image_magick/processor.rb:87:in `thumb'
dragonfly (0.9.12) lib/dragonfly/function_manager.rb:39:in `call'
dragonfly (0.9.12) lib/dragonfly/function_manager.rb:39:in `block (2 levels) in call_last'
dragonfly (0.9.12) lib/dragonfly/function_manager.rb:38:in `catch'
dragonfly (0.9.12) lib/dragonfly/function_manager.rb:38:in `block in call_last'
dragonfly (0.9.12) lib/dragonfly/function_manager.rb:37:in `each'
dragonfly (0.9.12) lib/dragonfly/function_manager.rb:37:in `call_last'
dragonfly (0.9.12) lib/dragonfly/processor.rb:5:in `process'
dragonfly (0.9.12) lib/dragonfly/job.rb:79:in `apply'
dragonfly (0.9.12) lib/dragonfly/job.rb:253:in `block in apply'
dragonfly (0.9.12) lib/dragonfly/job.rb:253:in `each'
dragonfly (0.9.12) lib/dragonfly/job.rb:253:in `apply'
dragonfly (0.9.12) lib/dragonfly/response.rb:25:in `to_response'
dragonfly (0.9.12) lib/dragonfly/server.rb:43:in `block in call'
dragonfly (0.9.12) lib/dragonfly/server.rb:39:in `catch'
dragonfly (0.9.12) lib/dragonfly/server.rb:39:in `call'
dragonfly (0.9.12) lib/dragonfly/middleware.rb:11:in `call'
rack-cache (1.2) lib/rack/cache/context.rb:136:in `forward'
rack-cache (1.2) lib/rack/cache/context.rb:245:in `fetch'
rack-cache (1.2) lib/rack/cache/context.rb:185:in `lookup'
rack-cache (1.2) lib/rack/cache/context.rb:66:in `call!'
rack-cache (1.2) lib/rack/cache/context.rb:51:in `call'
rack-cache (1.2) lib/rack/cache/context.rb:136:in `forward'
rack-cache (1.2) lib/rack/cache/context.rb:245:in `fetch'
rack-cache (1.2) lib/rack/cache/context.rb:185:in `lookup'
rack-cache (1.2) lib/rack/cache/context.rb:66:in `call!'
rack-cache (1.2) lib/rack/cache/context.rb:51:in `call'
actionpack (3.2.3) lib/action_dispatch/middleware/reloader.rb:65:in `call'
actionpack (3.2.3) lib/action_dispatch/middleware/remote_ip.rb:31:in `call'
actionpack (3.2.3) lib/action_dispatch/middleware/debug_exceptions.rb:16:in `call'
actionpack (3.2.3) lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
railties (3.2.3) lib/rails/rack/logger.rb:26:in `call_app'
railties (3.2.3) lib/rails/rack/logger.rb:16:in `call'
actionpack (3.2.3) lib/action_dispatch/middleware/request_id.rb:22:in `call'
rack (1.4.1) lib/rack/methodoverride.rb:21:in `call'
rack (1.4.1) lib/rack/runtime.rb:17:in `call'
activesupport (3.2.3) lib/active_support/cache/strategy/local_cache.rb:72:in `call'
rack (1.4.1) lib/rack/lock.rb:15:in `call'
actionpack (3.2.3) lib/action_dispatch/middleware/static.rb:62:in `call'
railties (3.2.3) lib/rails/engine.rb:479:in `call'
railties (3.2.3) lib/rails/application.rb:220:in `call'
railties (3.2.3) lib/rails/railtie/configurable.rb:30:in `method_missing'
passenger (3.0.11) lib/phusion_passenger/rack/request_handler.rb:96:in `process_request'
passenger (3.0.11) lib/phusion_passenger/abstract_request_handler.rb:513:in `accept_and_process_next_request'
passenger (3.0.11) lib/phusion_passenger/abstract_request_handler.rb:274:in `main_loop'
passenger (3.0.11) lib/phusion_passenger/classic_rails/application_spawner.rb:321:in `start_request_handler'
passenger (3.0.11) lib/phusion_passenger/classic_rails/application_spawner.rb:275:in `block in handle_spawn_application'
passenger (3.0.11) lib/phusion_passenger/utils.rb:479:in `safe_fork'
passenger (3.0.11) lib/phusion_passenger/classic_rails/application_spawner.rb:270:in `handle_spawn_application'
passenger (3.0.11) lib/phusion_passenger/abstract_server.rb:357:in `server_main_loop'
passenger (3.0.11) lib/phusion_passenger/abstract_server.rb:206:in `start_synchronously'
passenger (3.0.11) lib/phusion_passenger/abstract_server.rb:180:in `start'
passenger (3.0.11) lib/phusion_passenger/classic_rails/application_spawner.rb:149:in `start'
passenger (3.0.11) lib/phusion_passenger/spawn_manager.rb:219:in `block (2 levels) in spawn_rails_application'
passenger (3.0.11) lib/phusion_passenger/abstract_server_collection.rb:132:in `lookup_or_add'
passenger (3.0.11) lib/phusion_passenger/spawn_manager.rb:214:in `block in spawn_rails_application'
passenger (3.0.11) lib/phusion_passenger/abstract_server_collection.rb:82:in `block in synchronize'
<internal:prelude>:10:in `synchronize'
passenger (3.0.11) lib/phusion_passenger/abstract_server_collection.rb:79:in `synchronize'
passenger (3.0.11) lib/phusion_passenger/spawn_manager.rb:213:in `spawn_rails_application'
passenger (3.0.11) lib/phusion_passenger/spawn_manager.rb:132:in `spawn_application'
passenger (3.0.11) lib/phusion_passenger/spawn_manager.rb:275:in `handle_spawn_application'
passenger (3.0.11) lib/phusion_passenger/abstract_server.rb:357:in `server_main_loop'
passenger (3.0.11) lib/phusion_passenger/abstract_server.rb:206:in `start_synchronously'
passenger (3.0.11) helper-scripts/passenger-spawn-server:99:in `<main>'
UPDATE
I've added the code below to my config/application.rb file as suggested here and it helped some of the files show up, and but i'm still unable to upload a file through the app and part of this stacktrace is shown below.
config/application.rb contains this
initializer 'override-image-magick-paths', :after => 'attach-refinery-images-with-
dragonfly' do
app=Dragonfly[:refinery_images]
app.configure_with(:imagemagick)
app.configure do |c|
c.convert_command = "/usr/local/bin/convert" # defaults to "convert"
c.identify_command = "/usr/local/bin/identify" # defaults to "identify"
end
end
stacktrace
Dragonfly::Shell::CommandFailed (Command failed (identify '/tmp/RackMultipart20120708-20096-4m1k9j') with exit status 127):
dragonfly (0.9.12) lib/dragonfly/shell.rb:29:in `raise_shell_command_failed'
dragonfly (0.9.12) lib/dragonfly/shell.rb:23:in `run'
dragonfly (0.9.12) lib/dragonfly/image_magick/utils.rb:34:in `raw_identify'
dragonfly (0.9.12) lib/dragonfly/image_magick/utils.rb:24:in `identify'
dragonfly (0.9.12) lib/dragonfly/image_magick/analyser.rb:44:in `format'
dragonfly (0.9.12) lib/dragonfly/function_manager.rb:39:in `call'
dragonfly (0.9.12) lib/dragonfly/function_manager.rb:39:in `block (2 levels) in call_last'
dragonfly (0.9.12) lib/dragonfly/function_manager.rb:38:in `catch'
dragonfly (0.9.12) lib/dragonfly/function_manager.rb:38:in `block in call_last'
dragonfly (0.9.12) lib/dragonfly/function_manager.rb:37:in `each'
dragonfly (0.9.12) lib/dragonfly/function_manager.rb:37:in `call_last'
dragonfly (0.9.12) lib/dragonfly/analyser.rb:25:in `analyse'
dragonfly (0.9.12) lib/dragonfly/job.rb:247:in `analyse'
I simply reinstalled imagemagick and it worked.
I created a symbolic link from /usr/bin/convert -> /usr/local/bin/convert and from /usr/bin/identify -> /usr/local/bin/identify and that seemed to solve my problems.
$ cd /usr/bin
$ ln -s /usr/local/bin/convert convert
$ ln -s /usr/local/bin/identify identify
I'm assuming that dragonfly is still not picking up my location of convert and identify even though i specified it in my config/application.rb file.
You may have to provide the full path to convert:
config/initializers/dragonfly.rb:
app.configure do |c|
c.convert_command = "/usr/bin/convert"
end
Change /usr/bin/convert to the correct path to convert, which you can find out by running whereis convert on your VPS shell.
More details in the documentation.
Try installing the refinery-images gem:
Gemfile:
gem 'refinerycms-page-images', '~>1.0.3' //refinery v1 compatible (v2 available also)
Then in your model:
belongs_to :imagesizeyouwant, :class_name => 'Image'
If you look at the Image class you'll see a pretty nice set up for handling images. You can add image sizes in Refinery's Settings page in the admin tool. If you have a custom engine, just change :imagesizeyouwant to that size (mine was :thumbnail).
When you post the image, look at the output of the identify command and try to run it on your own. Chances are your system has different parameters it uses for ImageMagick binaries, or that the dimensions being sent to it are not understood. Try posting the output of the actual command Dragonfly is calling in the shell so we can take a better look.

ActionController::RoutingError (No route matches [GET] "/") with ALL pages

After deployment with Capistrano i get ActionController::RoutingError (No route matches [GET] "/") with ALL pages in production.log (and see 404 page instead). And I can see all routes by rake routes - they all are fine!!! What should i do now???
Production.log:
Started GET "/" for 79.143.104.251 at 2012-06-24 23:53:06 +0400
ActionController::RoutingError (No route matches [GET] "/"):
actionpack (3.2.3) lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'
actionpack (3.2.3) lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
railties (3.2.3) lib/rails/rack/logger.rb:26:in `call_app'
railties (3.2.3) lib/rails/rack/logger.rb:16:in `call'
actionpack (3.2.3) lib/action_dispatch/middleware/request_id.rb:22:in `call'
rack (1.4.1) lib/rack/methodoverride.rb:21:in `call'
rack (1.4.1) lib/rack/runtime.rb:17:in `call'
activesupport (3.2.3) lib/active_support/cache/strategy/local_cache.rb:72:in `call'
rack (1.4.1) lib/rack/lock.rb:15:in `call'
rack-cache (1.2) lib/rack/cache/context.rb:136:in `forward'
rack-cache (1.2) lib/rack/cache/context.rb:245:in `fetch'
rack-cache (1.2) lib/rack/cache/context.rb:185:in `lookup'
rack-cache (1.2) lib/rack/cache/context.rb:66:in `call!'
rack-cache (1.2) lib/rack/cache/context.rb:51:in `call'
railties (3.2.3) lib/rails/engine.rb:479:in `call'
railties (3.2.3) lib/rails/application.rb:220:in `call'
railties (3.2.3) lib/rails/railtie/configurable.rb:30:in `method_missing'
unicorn (4.3.1) lib/unicorn/http_server.rb:531:in `process_client'
unicorn (4.3.1) lib/unicorn/http_server.rb:606:in `worker_loop'
unicorn (4.3.1) lib/unicorn/http_server.rb:487:in `spawn_missing_workers'
unicorn (4.3.1) lib/unicorn/http_server.rb:498:in `maintain_worker_count'
unicorn (4.3.1) lib/unicorn/http_server.rb:272:in `join'
unicorn (4.3.1) bin/unicorn:121:in `<top (required)>'
/home/centervakansiy/apps/centervakansiy/shared/bundle/ruby/1.9.1/bin/unicorn:23:in `load'
/home/centervakansiy/apps/centervakansiy/shared/bundle/ruby/1.9.1/bin/unicorn:23:in `<main>'
The problem was you probably made a change to your router or model and did not restart. In order to view those changes, you must restart the server.

"undefined method `process_route'" when going to resque web ui

I just started getting this error when going to the Resque web ui on my server. It does not happen locally, and it did not happen before some recent app changes/upgrades I made. I made no changes to the server itself. I could start reverting back changelists to see where it broke, but I upgraded a lot of gems at once so I have a hunch it'll be quite tricky.
So, any idea what would cause this or where it might be originating?
The path I'm going to is mydomain.com/app/resque
routes.rb
scope :path => "/app" do
mount Resque::Server.new, :at => '/resque'
end
NoMethodError (undefined method `process_route' for #<Resque::Server:0x00000005dc95b0>):
newrelic_rpm (3.3.4.1) lib/new_relic/agent/instrumentation/sinatra.rb:38:in `block in dispatch_with_newrelic'
newrelic_rpm (3.3.4.1) lib/new_relic/agent/instrumentation/sinatra.rb:62:in `block in transaction_name'
newrelic_rpm (3.3.4.1) lib/new_relic/agent/instrumentation/sinatra.rb:61:in `each'
newrelic_rpm (3.3.4.1) lib/new_relic/agent/instrumentation/sinatra.rb:61:in `transaction_name'
newrelic_rpm (3.3.4.1) lib/new_relic/agent/instrumentation/sinatra.rb:37:in `dispatch_with_newrelic'
sinatra (1.0) lib/sinatra/base.rb:411:in `block in call!'
sinatra (1.0) lib/sinatra/base.rb:566:in `instance_eval'
sinatra (1.0) lib/sinatra/base.rb:566:in `block in invoke'
sinatra (1.0) lib/sinatra/base.rb:566:in `catch'
sinatra (1.0) lib/sinatra/base.rb:566:in `invoke'
sinatra (1.0) lib/sinatra/base.rb:411:in `call!'
sinatra (1.0) lib/sinatra/base.rb:399:in `call'
rack (1.4.1) lib/rack/auth/basic.rb:25:in `call'
sinatra (1.0) lib/sinatra/base.rb:979:in `block in call'
sinatra (1.0) lib/sinatra/base.rb:1005:in `synchronize'
sinatra (1.0) lib/sinatra/base.rb:979:in `call'
actionpack (3.2.1) lib/action_dispatch/routing/mapper.rb:40:in `call'
journey (1.0.3) lib/journey/router.rb:68:in `block in call'
journey (1.0.3) lib/journey/router.rb:56:in `each'
journey (1.0.3) lib/journey/router.rb:56:in `call'
actionpack (3.2.1) lib/action_dispatch/routing/route_set.rb:589:in `call'
omniauth (1.1.0) lib/omniauth/strategy.rb:177:in `call!'
omniauth (1.1.0) lib/omniauth/strategy.rb:157:in `call'
omniauth (1.1.0) lib/omniauth/builder.rb:48:in `call'
newrelic_rpm (3.3.4.1) lib/new_relic/rack/browser_monitoring.rb:23:in `call'
airbrake (3.0.9) lib/airbrake/rack.rb:27:in `call'
warden (1.1.1) lib/warden/manager.rb:35:in `block in call'
warden (1.1.1) lib/warden/manager.rb:34:in `catch'
warden (1.1.1) lib/warden/manager.rb:34:in `call'
actionpack (3.2.1) lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'
rack (1.4.1) lib/rack/etag.rb:23:in `call'
rack (1.4.1) lib/rack/conditionalget.rb:25:in `call'
actionpack (3.2.1) lib/action_dispatch/middleware/head.rb:14:in `call'
remotipart (1.0.2) lib/remotipart/middleware.rb:30:in `call'
actionpack (3.2.1) lib/action_dispatch/middleware/params_parser.rb:21:in `call'
actionpack (3.2.1) lib/action_dispatch/middleware/flash.rb:242:in `call'
rack (1.4.1) lib/rack/session/abstract/id.rb:205:in `context'
rack (1.4.1) lib/rack/session/abstract/id.rb:200:in `call'
actionpack (3.2.1) lib/action_dispatch/middleware/cookies.rb:338:in `call'
activerecord (3.2.1) lib/active_record/query_cache.rb:64:in `call'
activerecord (3.2.1) lib/active_record/connection_adapters/abstract/connection_pool.rb:443:in `call'
actionpack (3.2.1) lib/action_dispatch/middleware/callbacks.rb:28:in `block in call'
activesupport (3.2.1) lib/active_support/callbacks.rb:405:in `_run__2652675143263662148__call__736553824066291236__callbacks'
activesupport (3.2.1) lib/active_support/callbacks.rb:405:in `__run_callback'
activesupport (3.2.1) lib/active_support/callbacks.rb:385:in `_run_call_callbacks'
activesupport (3.2.1) lib/active_support/callbacks.rb:81:in `run_callbacks'
actionpack (3.2.1) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
actionpack (3.2.1) lib/action_dispatch/middleware/remote_ip.rb:31:in `call'
actionpack (3.2.1) lib/action_dispatch/middleware/debug_exceptions.rb:16:in `call'
actionpack (3.2.1) lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
railties (3.2.1) lib/rails/rack/logger.rb:26:in `call_app'
railties (3.2.1) lib/rails/rack/logger.rb:16:in `call'
actionpack (3.2.1) lib/action_dispatch/middleware/request_id.rb:22:in `call'
rack (1.4.1) lib/rack/methodoverride.rb:21:in `call'
rack (1.4.1) lib/rack/runtime.rb:17:in `call'
rack (1.4.1) lib/rack/lock.rb:15:in `call'
rack-ssl (1.3.2) lib/rack/ssl.rb:27:in `call'
rack-cache (1.2) lib/rack/cache/context.rb:136:in `forward'
rack-cache (1.2) lib/rack/cache/context.rb:245:in `fetch'
rack-cache (1.2) lib/rack/cache/context.rb:185:in `lookup'
rack-cache (1.2) lib/rack/cache/context.rb:66:in `call!'
rack-cache (1.2) lib/rack/cache/context.rb:51:in `call'
airbrake (3.0.9) lib/airbrake/user_informer.rb:12:in `call'
railties (3.2.1) lib/rails/engine.rb:479:in `call'
railties (3.2.1) lib/rails/application.rb:220:in `call'
railties (3.2.1) lib/rails/railtie/configurable.rb:30:in `method_missing'
/usr/local/rvm/gems/ruby-1.9.3-p0#global/gems/passenger-3.0.11/lib/phusion_passenger/rack/request_handler.rb:96:in `process_request'
/usr/local/rvm/gems/ruby-1.9.3-p0#global/gems/passenger-3.0.11/lib/phusion_passenger/abstract_request_handler.rb:513:in `accept_and_process_next_request'
/usr/local/rvm/gems/ruby-1.9.3-p0#global/gems/passenger-3.0.11/lib/phusion_passenger/abstract_request_handler.rb:274:in `main_loop'
/usr/local/rvm/gems/ruby-1.9.3-p0#global/gems/passenger-3.0.11/lib/phusion_passenger/rack/application_spawner.rb:206:in `start_request_handler'
/usr/local/rvm/gems/ruby-1.9.3-p0#global/gems/passenger-3.0.11/lib/phusion_passenger/rack/application_spawner.rb:171:in `block in handle_spawn_application'
/usr/local/rvm/gems/ruby-1.9.3-p0#global/gems/passenger-3.0.11/lib/phusion_passenger/utils.rb:479:in `safe_fork'
/usr/local/rvm/gems/ruby-1.9.3-p0#global/gems/passenger-3.0.11/lib/phusion_passenger/rack/application_spawner.rb:166:in `handle_spawn_application'
/usr/local/rvm/gems/ruby-1.9.3-p0#global/gems/passenger-3.0.11/lib/phusion_passenger/abstract_server.rb:357:in `server_main_loop'
/usr/local/rvm/gems/ruby-1.9.3-p0#global/gems/passenger-3.0.11/lib/phusion_passenger/abstract_server.rb:206:in `start_synchronously'
/usr/local/rvm/gems/ruby-1.9.3-p0#global/gems/passenger-3.0.11/lib/phusion_passenger/abstract_server.rb:180:in `start'
/usr/local/rvm/gems/ruby-1.9.3-p0#global/gems/passenger-3.0.11/lib/phusion_passenger/rack/application_spawner.rb:129:in `start'
/usr/local/rvm/gems/ruby-1.9.3-p0#global/gems/passenger-3.0.11/lib/phusion_passenger/spawn_manager.rb:253:in `block (2 levels) in spawn_rack_application'
/usr/local/rvm/gems/ruby-1.9.3-p0#global/gems/passenger-3.0.11/lib/phusion_passenger/abstract_server_collection.rb:132:in `lookup_or_add'
/usr/local/rvm/gems/ruby-1.9.3-p0#global/gems/passenger-3.0.11/lib/phusion_passenger/spawn_manager.rb:246:in `block in spawn_rack_application'
/usr/local/rvm/gems/ruby-1.9.3-p0#global/gems/passenger-3.0.11/lib/phusion_passenger/abstract_server_collection.rb:82:in `block in synchronize'
<internal:prelude>:10:in `synchronize'
/usr/local/rvm/gems/ruby-1.9.3-p0#global/gems/passenger-3.0.11/lib/phusion_passenger/abstract_server_collection.rb:79:in `synchronize'
/usr/local/rvm/gems/ruby-1.9.3-p0#global/gems/passenger-3.0.11/lib/phusion_passenger/spawn_manager.rb:244:in `spawn_rack_application'
/usr/local/rvm/gems/ruby-1.9.3-p0#global/gems/passenger-3.0.11/lib/phusion_passenger/spawn_manager.rb:137:in `spawn_application'
/usr/local/rvm/gems/ruby-1.9.3-p0#global/gems/passenger-3.0.11/lib/phusion_passenger/spawn_manager.rb:275:in `handle_spawn_application'
/usr/local/rvm/gems/ruby-1.9.3-p0#global/gems/passenger-3.0.11/lib/phusion_passenger/abstract_server.rb:357:in `server_main_loop'
/usr/local/rvm/gems/ruby-1.9.3-p0#global/gems/passenger-3.0.11/lib/phusion_passenger/abstract_server.rb:206:in `start_synchronously'
/usr/local/rvm/gems/ruby-1.9.3-p0#global/gems/passenger-3.0.11/helper-scripts/passenger-spawn-server:99:in `<main>'
You are combining a new version of new_relic with a very old version of sinatra. Run bundle update sinatra and make sure you have at least Sinatra 1.3.0, or try to downgrade the new_relic gem.
If you wonder why you have sinatra in your bundle at all: resque depends on it.
You could also add an explicite rule for a newer sinatra or an older new_relic to your Gemfile.
I resolved this by modifying my Gemfile to have the following lines:
gem 'sinatra', ">= 1.3.0"
gem 'newrelic_rpm'
gem 'resque'

Resources