Rails 2 应用程序RubyGems 1.8.7 失败
将 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。
After upgrading RubyGems to 1.8.7 from a much older version our Rails 2 apps will no longer boot. A NoMethodError is raised with the message undefined method 'name' for "POpen4":String
. The full stack trace follows:
[ 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 apps are booting and running fine. Anyone have any ideas on what the error is and how we can fix it?
For some environment information - we're using Phusion Passenger 3.0.8, Nginx and REE 1.8.7.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
将应用程序升级到 2.3.12 可能会解决您在使用较新版本的 Ruby 时遇到的一些兼容性问题。维护版本通常会关注这些内容。
Upgrading your application to 2.3.12 may address some of the compatibility problems you're experiencing with a newer version of Ruby. The maintenance releases generally keep on top of these things.
对我来说,修复方法是降级 rubygems:
For me the fix was to downgrade rubygems: