Error Calling Dispatcher Dispatch Nomethoderror Undefined Method For Nil
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Weird problem with Rails app and Mongrel up vote 13 down vote favorite I originally posted a question relating to this problem on serverfault.com: http://serverfault.com/questions/152587/apache-mod-proxy-to-another-server I have since realized that this is not an issue with my server setup, but my rails application. I have set this application up server-wise the exact same as another functioning rails app I have running on the same server. When I start the server my mongrel.log looks like this: ** Daemonized, any open files are closed. Look at /var/www/osuwebdev/tmp/pids/mongrel.pid and log/mongrel.log for info. ** Starting Mongrel listening at 0.0.0.0:8080 ** Starting Rails with production environment... ** Rails loaded. ** Loading any Rails specific GemPlugins ** Signals ready. TERM => stop. USR2 => restart. INT => stop (no restart). ** Rails signals registered. HUP => reload (without restart). It might not work well. ** Mongrel 1.1.5 available at 0.0.0.0:8080 ** Writing PID file to /var/www/osuwebdev/tmp/pids/mongrel.pid When I load a page this pops up in the log: Wed Jun 30 19:46:10 +0000 2010: Error calling Dispatcher.dispatch #
hopefully this will help you save a little time. The environment prior to upgrade: rails 2.3.2 ruby 1.8.6 rack 1.1.5 rubygems 1.3.1 mongrel 1.1.5 nginx I hade one console tab open tailing the mongrel log at all times so I could see when something broke. Having not worked with a mongrel rails app, I didn't know where I would find the log, but it was in the app's log directory (of course). The first step was to install the Rails gem: http://stackoverflow.com/questions/3152909/weird-problem-with-rails-app-and-mongrel class="go">sudo gem install rails -v 2.3.15 If you see these messages, just ignore them because they don't cause an error: config.load_paths is deprecated and removed in Rails 3, please use autoload_paths instead Next, update rails version in config/environment.rb: RAILS_GEM_VERSION = '2.3.15' unless defined? RAILS_GEM_VERSION Vendored Gems If your app has a vendored version of rails, remove it http://www.andrewhavens.com/posts/23/how-to-upgrade-a-rails-2.3.2-app-to-rails-2.3.15/ because we're going to use the one we just installed: rm -rf vendor/rails If you have any files (non-directories) in vendor/gems, remove those too: rm vendor/gems/init.rb If you have any errors in the log about your vendored gems missing .specification files, make sure the gem is installed with ruby gems first, then use the rake task to create the specs: rake gems:refresh_specs Rake If you have any rake errors, you will see the message of what you need to fix. RubyGems You might have seen this error before upgrading Rails: Warning: Gem::Dependency#version_requirements is deprecated and will be removed on or after August 2010. Use #requirement And if you see this error after upgrading Rails... /usr/lib/ruby/gems/1.8/gems/rails-2.3.15/lib/rails/gem_dependency.rb:81:in `add_load_paths': undefined method `requirement' for # Translation patches Defect #7688 Redmine's trunk (rails 2.3.11) doesn't work with Mongrel 1.1.x Added by Jean-Baptiste Barth over 5 years ago. Updated over 4 years ago. Status:ClosedStart date:2011-02-22Priority:NormalDue date:Assignee:-% Done:0%Category:Gems supportTarget version:- Resolution:Wont fix Affected version: Description I reproduce here http://www.redmine.org/issues/7688 Etienne's comment in #6887 (Rails upgrade) : Note that Mongrel 1.1.5 does not work anymore with Rails 2.3.8 or later because of 2 bugs respectively in rack 1.1.x and Mongrel 1.1.5. See ticket 4690 in Rails tracker and ticket 5 in Mongrel's. Until Mongrel 1.2.0 is out, it is required to add a mongrel.rb initializer to config/initializers. I can't reproduce with "mongrel + script/server", but I confirm "mongrel_rails" crashes, and I confirm the error calling proposed initializer solves the problem on a development instance. A few questions : does anybody know if it affects Thin too ? can anybody test it some days in production to see if it doesn't have any drawback ? There's no feedback on rails lighthouse tracker for the moment.. mongrel.rb - mongrel.rb (2.83 KB) Giuseppe Lippolis, 2011-12-11 22:35 Related issues Related to Redmine - Feature #6887: Upgrade to Rails 2.3.11 Closed 2010-11-13 Related error calling dispatcher to Redmine - Defect #8520: "Error 500" on login to a fresh Redmine 1.2.0 install Closed 2011-06-03 Related to Duplicates Duplicated by Blocks Blocked by Precedes Follows Copied to Copied from Issue # Delay: days Cancel History #1 Updated by Etienne Massip over 5 years ago I'm running it in production (low traffic, only 4-5 daily users) since this morning and had no problem until now. Do you plan to commit it into config/initializers ? I thought to simply add a HowTo when 1.2.0 is out... #2 Updated by Jean-Baptiste Barth over 5 years ago Yes, I think we should add it to config/initializers so it will be transparent for users. Or we will have tons of support requests for this, and Rails ticket isn't an easy read for everybody... #3 Updated by Ivan Cenov over 5 years ago Hmmmm..., Mongrel 1.1.5 is released on May 22, 2008. Is this project developed at all? #4 Updated by Etienne Massip over 5 years ago Last commit is dated of July 24, 2010. But it is still used. #5 Updated by Ivan Cenov over 5 years ago Most Active This Week shows 96.90% activity.On the other side, http://mongrel.rubyforge.org/svn/ does not respond just now. Besides of this, I have installed patch_for_mongrel.rb that resolves what is described in this thread. This i