Rails - 500内部服务器错误

时间:2011-05-24 15:36:25

标签: ruby-on-rails

当我尝试启动一个旧的应用程序时,我收到以下错误,似乎无法确定问题所在。我收到'call_with_exception'错误,谷歌搜索没有提供任何帮助。有人能指出我正确的方向吗?我使用的是Rails 2.3.5,Ruby 1.8.7和使用RVM。

$ script/server 
=> Booting Mongrel
=> Rails 2.3.5 application starting on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
  SQL (0.1ms)   SET SQL_AUTO_IS_NULL=0
/!\ FAILSAFE /!\  Tue May 24 08:31:57 -0700 2011
  Status: 500 Internal Server Error
  undefined method `call_with_exception' for ApplicationController:Class
    /Users/my_user_dir/.rvm/gems/ruby-1.8.7-p334@rails235/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb:90:in `dispatch'
    /Users/my_user_dir/.rvm/gems/ruby-1.8.7-p334@rails235/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb:121:in `_call'
    /Users/my_user_dir/.rvm/gems/ruby-1.8.7-p334@rails235/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb:130:in `build_middleware_stack'
    /Users/my_user_dir/.rvm/gems/ruby-1.8.7-p334@rails235/gems/activerecord-2.3.5/lib/active_record/query_cache.rb:29:in `call'
    /Users/my_user_dir/.rvm/gems/ruby-1.8.7-p334@rails235/gems/activerecord-2.3.5/lib/active_record/query_cache.rb:29:in `call'
    /Users/my_user_dir/.rvm/gems/ruby-1.8.7-p334@rails235/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/query_cache.rb:34:in `cache'
    /Users/my_user_dir/.rvm/gems/ruby-1.8.7-p334@rails235/gems/activerecord-2.3.5/lib/active_record/query_cache.rb:9:in `cache'
    /Users/my_user_dir/.rvm/gems/ruby-1.8.7-p334@rails235/gems/activerecord-2.3.5/lib/active_record/query_cache.rb:28:in `call'
    /Users/my_user_dir/.rvm/gems/ruby-1.8.7-p334@rails235/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:361:in `call'
    /Users/my_user_dir/.rvm/gems/ruby-1.8.7-p334@rails235/gems/actionpack-2.3.5/lib/action_controller/string_coercion.rb:25:in `call'
    /Users/my_user_dir/.rvm/gems/ruby-1.8.7-p334@rails235/gems/rack-1.0.1/lib/rack/head.rb:9:in `call'
    /Users/my_user_dir/.rvm/gems/ruby-1.8.7-p334@rails235/gems/rack-1.0.1/lib/rack/methodoverride.rb:24:in `call'
    /Users/my_user_dir/.rvm/gems/ruby-1.8.7-p334@rails235/gems/actionpack-2.3.5/lib/action_controller/params_parser.rb:15:in `call'
    /Users/my_user_dir/.rvm/gems/ruby-1.8.7-p334@rails235/gems/actionpack-2.3.5/lib/action_controller/session/cookie_store.rb:93:in `call'
    /Users/my_user_dir/.rvm/gems/ruby-1.8.7-p334@rails235/gems/actionpack-2.3.5/lib/action_controller/failsafe.rb:26:in `call'
    /Users/my_user_dir/.rvm/gems/ruby-1.8.7-p334@rails235/gems/rack-1.0.1/lib/rack/lock.rb:11:in `call'
    /Users/my_user_dir/.rvm/gems/ruby-1.8.7-p334@rails235/gems/rack-1.0.1/lib/rack/lock.rb:11:in `synchronize'
    /Users/my_user_dir/.rvm/gems/ruby-1.8.7-p334@rails235/gems/rack-1.0.1/lib/rack/lock.rb:11:in `call'
    /Users/my_user_dir/.rvm/gems/ruby-1.8.7-p334@rails235/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb:114:in `call'
    /Users/my_user_dir/.rvm/gems/ruby-1.8.7-p334@rails235/gems/actionpack-2.3.5/lib/action_controller/reloader.rb:34:in `run'
    /Users/my_user_dir/.rvm/gems/ruby-1.8.7-p334@rails235/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb:108:in `call'
    /Users/my_user_dir/.rvm/gems/ruby-1.8.7-p334@rails235/gems/rails-2.3.5/lib/rails/rack/static.rb:31:in `call'
    /Users/my_user_dir/.rvm/gems/ruby-1.8.7-p334@rails235/gems/rack-1.0.1/lib/rack/urlmap.rb:46:in `call'
    /Users/my_user_dir/.rvm/gems/ruby-1.8.7-p334@rails235/gems/rack-1.0.1/lib/rack/urlmap.rb:40:in `each'
    /Users/my_user_dir/.rvm/gems/ruby-1.8.7-p334@rails235/gems/rack-1.0.1/lib/rack/urlmap.rb:40:in `call'
    /Users/my_user_dir/.rvm/gems/ruby-1.8.7-p334@rails235/gems/rails-2.3.5/lib/rails/rack/log_tailer.rb:17:in `call'
    /Users/my_user_dir/.rvm/gems/ruby-1.8.7-p334@rails235/gems/rack-1.0.1/lib/rack/content_length.rb:13:in `call'
    /Users/my_user_dir/.rvm/gems/ruby-1.8.7-p334@rails235/gems/rack-1.0.1/lib/rack/chunked.rb:15:in `call'
    /Users/my_user_dir/.rvm/gems/ruby-1.8.7-p334@rails235/gems/rack-1.0.1/lib/rack/handler/mongrel.rb:64:in `process'
    /Users/my_user_dir/.rvm/gems/ruby-1.8.7-p334@rails235/gems/mongrel-1.1.5/lib/mongrel.rb:159:in `process_client'
    /Users/my_user_dir/.rvm/gems/ruby-1.8.7-p334@rails235/gems/mongrel-1.1.5/lib/mongrel.rb:158:in `each'
    /Users/my_user_dir/.rvm/gems/ruby-1.8.7-p334@rails235/gems/mongrel-1.1.5/lib/mongrel.rb:158:in `process_client'
    /Users/my_user_dir/.rvm/gems/ruby-1.8.7-p334@rails235/gems/mongrel-1.1.5/lib/mongrel.rb:285:in `run'
    /Users/my_user_dir/.rvm/gems/ruby-1.8.7-p334@rails235/gems/mongrel-1.1.5/lib/mongrel.rb:285:in `initialize'
    /Users/my_user_dir/.rvm/gems/ruby-1.8.7-p334@rails235/gems/mongrel-1.1.5/lib/mongrel.rb:285:in `new'
    /Users/my_user_dir/.rvm/gems/ruby-1.8.7-p334@rails235/gems/mongrel-1.1.5/lib/mongrel.rb:285:in `run'
    /Users/my_user_dir/.rvm/gems/ruby-1.8.7-p334@rails235/gems/mongrel-1.1.5/lib/mongrel.rb:268:in `initialize'
    /Users/my_user_dir/.rvm/gems/ruby-1.8.7-p334@rails235/gems/mongrel-1.1.5/lib/mongrel.rb:268:in `new'
    /Users/my_user_dir/.rvm/gems/ruby-1.8.7-p334@rails235/gems/mongrel-1.1.5/lib/mongrel.rb:268:in `run'
    /Users/my_user_dir/.rvm/gems/ruby-1.8.7-p334@rails235/gems/rack-1.0.1/lib/rack/handler/mongrel.rb:34:in `run'
    /Users/my_user_dir/.rvm/gems/ruby-1.8.7-p334@rails235/gems/rails-2.3.5/lib/commands/server.rb:111
    /Users/my_user_dir/.rvm/rubies/ruby-1.8.7-p334/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:29:in `gem_original_require'
    /Users/my_user_dir/.rvm/rubies/ruby-1.8.7-p334/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:29:in `require'
    script/server:3

1 个答案:

答案 0 :(得分:0)

首先,您可能已经知道,请确保使用正确的红宝石版本

rvm list #find the right ruby-1.8.7 version you have used to get this app running back then

然后(例如,如果您使用了p249)

rvm ruby-1.8.7-p249

如果这不起作用,那么现在是一个有点冒险和调试rails核心的好时机。 “put”方法在这里有很多帮助。

我亲自将我的导轨冻结到我的应用程序之前,然后直接在那里进行任何更改(不推荐,大多数时候我会混合使用但不是所有时间)。

冻结铁轨宝石:

rake gems:unpack

然后

rake gems:install