Rails 2应用程序+ RubyGems 1.8.7失败

时间:2011-08-05 15:20:45

标签: ruby-on-rails ruby rubygems passenger

从较旧版本升级RubyGems到1.8.7后,我们的Rails 2应用程序将不再启动。引发NoMethodError并显示消息undefined method 'name' for "POpen4":String。完整的堆栈跟踪如下:

[ pid=5996 thr=71772310 file=utils.rb:176 time=2011-08-05 16:14:59.635 ]: *** Exception NoMethodError in PhusionPassenger::ClassicRails::ApplicationSpawner (undefined method `name' for "POpen4":String) (process 5996, thread #<Thread:0x88e512c>):
    from /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/rails-2.3.2/lib/rails/gem_dependency.rb:239:in `=='
    from /opt/ruby-enterprise/lib/ruby/site_ruby/1.8/rubygems/dependency.rb:217:in `==='
    from /opt/ruby-enterprise/lib/ruby/site_ruby/1.8/rubygems/dependency.rb:217:in `matching_specs'
    from /opt/ruby-enterprise/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `find_all'
    from /opt/ruby-enterprise/lib/ruby/site_ruby/1.8/rubygems/specification.rb:410:in `each'
    from /opt/ruby-enterprise/lib/ruby/site_ruby/1.8/rubygems/specification.rb:409:in `each'
    from /opt/ruby-enterprise/lib/ruby/site_ruby/1.8/rubygems/dependency.rb:216:in `find_all'
    from /opt/ruby-enterprise/lib/ruby/site_ruby/1.8/rubygems/dependency.rb:216:in `matching_specs'
    from /opt/ruby-enterprise/lib/ruby/site_ruby/1.8/rubygems/dependency.rb:238:in `to_specs'
    from /opt/ruby-enterprise/lib/ruby/site_ruby/1.8/rubygems/dependency.rb:256:in `to_spec'
    from /opt/ruby-enterprise/lib/ruby/site_ruby/1.8/rubygems.rb:1200:in `gem'
    from /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/rails-2.3.2/lib/rails/gem_dependency.rb:57:in `add_load_paths'
    from /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/rails-2.3.2/lib/initializer.rb:299:in `add_gem_load_paths'
    from /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/rails-2.3.2/lib/initializer.rb:299:in `each'
    from /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/rails-2.3.2/lib/initializer.rb:299:in `add_gem_load_paths'
    from /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/rails-2.3.2/lib/initializer.rb:132:in `process'
    from /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/rails-2.3.2/lib/initializer.rb:113:in `send'
    from /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/rails-2.3.2/lib/initializer.rb:113:in `run'
    from /theapplicationdir/config/environment.rb:5
    from /opt/ruby-enterprise/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
    from /opt/ruby-enterprise/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `require'
    from /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/passenger-3.0.8/lib/phusion_passenger/classic_rails/application_spawner.rb:222:in `preload_application'
    from /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/passenger-3.0.8/lib/phusion_passenger/classic_rails/application_spawner.rb:181:in `initialize_server'
    from /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/passenger-3.0.8/lib/phusion_passenger/utils.rb:572:in `report_app_init_status'
    from /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/passenger-3.0.8/lib/phusion_passenger/classic_rails/application_spawner.rb:174:in `initialize_server'
    from /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/passenger-3.0.8/lib/phusion_passenger/abstract_server.rb:204:in `start_synchronously'
    from /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/passenger-3.0.8/lib/phusion_passenger/abstract_server.rb:180:in `start'
    from /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/passenger-3.0.8/lib/phusion_passenger/classic_rails/application_spawner.rb:149:in `start'
    from /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/passenger-3.0.8/lib/phusion_passenger/spawn_manager.rb:219:in `spawn_rails_application'
    from /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/passenger-3.0.8/lib/phusion_passenger/abstract_server_collection.rb:132:in `lookup_or_add'
    from /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/passenger-3.0.8/lib/phusion_passenger/spawn_manager.rb:214:in `spawn_rails_application'
    from /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/passenger-3.0.8/lib/phusion_passenger/abstract_server_collection.rb:82:in `synchronize'
    from /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/passenger-3.0.8/lib/phusion_passenger/abstract_server_collection.rb:79:in `synchronize'
    from /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/passenger-3.0.8/lib/phusion_passenger/spawn_manager.rb:213:in `spawn_rails_application'
    from /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/passenger-3.0.8/lib/phusion_passenger/spawn_manager.rb:132:in `spawn_application'
    from /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/passenger-3.0.8/lib/phusion_passenger/spawn_manager.rb:275:in `handle_spawn_application'
    from /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/passenger-3.0.8/lib/phusion_passenger/abstract_server.rb:357:in `__send__'
    from /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/passenger-3.0.8/lib/phusion_passenger/abstract_server.rb:357:in `server_main_loop'
    from /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/passenger-3.0.8/lib/phusion_passenger/abstract_server.rb:206:in `start_synchronously'
    from /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/passenger-3.0.8/helper-scripts/passenger-spawn-server:99

Rails 3应用程序正在启动并正常运行。任何人对错误是什么以及我们如何解决它有任何想法?

对于某些环境信息 - 我们使用的是Phusion Passenger 3.0.8,Nginx和REE 1.8.7。

2 个答案:

答案 0 :(得分:3)

将您的应用程序升级到2.3.12可能会解决您在使用较新版本的Ruby时遇到的一些兼容性问题。维护版本通常会保留在这些内容之上。

答案 1 :(得分:1)

对我来说,解决方法是降级rubygems:

$ gem update --system 1.3.6