乘客还是..? PhusionPassenger :: ClassicRails :: ApplicationSpawner中的异常RuntimeError

时间:2016-05-12 16:22:28

标签: ruby-on-rails ruby rubygems debian passenger

昨天我需要在Debian 6上重启生产服务器,正常运行时间超过3年,第三方配置计费系统。由于“原因”,我们没有该公司的支持,也根本没有任何支持。

据我所知,自配置完成以来,服务器从未重新启动过。 从那以后,计费的Web界面在成功登录后显示500内部服务器错误。

我不知道该怎么做,检查了所有oracle,billing-system和apache日志。现在我认为我将问题本地化了,apache日志说:

[Thu May 12 13:32:18 2016] [notice] Apache/2.2.22 (Debian) Phusion_Passenger/3.0.11 configured -- resuming normal operations
[ pid=3030 thr=12538160 file=utils.rb:176 time=2016-05-12 16:51:49.463 ]: *** Exception RuntimeError in PhusionPassenger::ClassicRails::ApplicationSpawner (Bundler couldn't find some gems.Did you run `bundle install`?) (process 3030, thread #<Thread:0x17ea260>):
        from /opt/hydra/rails/arm_isp_old/releases/20120928113940/config/preinitializer.rb:18
        from /opt/hydra/rails/.rvm/rubies/ree-1.8.7-2011.03/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
        from /opt/hydra/rails/.rvm/rubies/ree-1.8.7-2011.03/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `require'
        from /opt/hydra/rails/.rvm/gems/ree-1.8.7-2011.03@global/gems/passenger-3.0.11/lib/phusion_passenger/classic_rails/application_spawner.rb:220:in `preload_application'
        from /opt/hydra/rails/.rvm/gems/ree-1.8.7-2011.03@global/gems/passenger-3.0.11/lib/phusion_passenger/classic_rails/application_spawner.rb:181:in `initialize_server'
        from /opt/hydra/rails/.rvm/gems/ree-1.8.7-2011.03@global/gems/passenger-3.0.11/lib/phusion_passenger/utils.rb:572:in `report_app_init_status'
        from /opt/hydra/rails/.rvm/gems/ree-1.8.7-2011.03@global/gems/passenger-3.0.11/lib/phusion_passenger/classic_rails/application_spawner.rb:174:in `initialize_server'
        from /opt/hydra/rails/.rvm/gems/ree-1.8.7-2011.03@global/gems/passenger-3.0.11/lib/phusion_passenger/abstract_server.rb:204:in `start_synchronously'
        from /opt/hydra/rails/.rvm/gems/ree-1.8.7-2011.03@global/gems/passenger-3.0.11/lib/phusion_passenger/abstract_server.rb:180:in `start'
        from /opt/hydra/rails/.rvm/gems/ree-1.8.7-2011.03@global/gems/passenger-3.0.11/lib/phusion_passenger/classic_rails/application_spawner.rb:149:in `start'
        from /opt/hydra/rails/.rvm/gems/ree-1.8.7-2011.03@global/gems/passenger-3.0.11/lib/phusion_passenger/spawn_manager.rb:219:in `spawn_rails_application'
        from /opt/hydra/rails/.rvm/gems/ree-1.8.7-2011.03@global/gems/passenger-3.0.11/lib/phusion_passenger/abstract_server_collection.rb:132:in `lookup_or_add'
        from /opt/hydra/rails/.rvm/gems/ree-1.8.7-2011.03@global/gems/passenger-3.0.11/lib/phusion_passenger/spawn_manager.rb:214:in `spawn_rails_application'
        from /opt/hydra/rails/.rvm/gems/ree-1.8.7-2011.03@global/gems/passenger-3.0.11/lib/phusion_passenger/abstract_server_collection.rb:82:in `synchronize'
        from /opt/hydra/rails/.rvm/gems/ree-1.8.7-2011.03@global/gems/passenger-3.0.11/lib/phusion_passenger/abstract_server_collection.rb:79:in `synchronize'
        from /opt/hydra/rails/.rvm/gems/ree-1.8.7-2011.03@global/gems/passenger-3.0.11/lib/phusion_passenger/spawn_manager.rb:213:in `spawn_rails_application'
        from /opt/hydra/rails/.rvm/gems/ree-1.8.7-2011.03@global/gems/passenger-3.0.11/lib/phusion_passenger/spawn_manager.rb:132:in `spawn_application'
        from /opt/hydra/rails/.rvm/gems/ree-1.8.7-2011.03@global/gems/passenger-3.0.11/lib/phusion_passenger/spawn_manager.rb:275:in `handle_spawn_application'
        from /opt/hydra/rails/.rvm/gems/ree-1.8.7-2011.03@global/gems/passenger-3.0.11/lib/phusion_passenger/abstract_server.rb:357:in `__send__'
        from /opt/hydra/rails/.rvm/gems/ree-1.8.7-2011.03@global/gems/passenger-3.0.11/lib/phusion_passenger/abstract_server.rb:357:in `server_main_loop'
        from /opt/hydra/rails/.rvm/gems/ree-1.8.7-2011.03@global/gems/passenger-3.0.11/lib/phusion_passenger/abstract_server.rb:206:in `start_synchronously'
        from /opt/hydra/rails/.rvm/gems/ree-1.8.7-2011.03@global/gems/passenger-3.0.11/helper-scripts/passenger-spawn-server:99

有趣的事情:

  • 我根本找不到安装在系统中的宝石或红宝石。当我尝试 install,apt-get显示需要升级的包太多,所以
    我害怕做事变得更糟。
  • 的Env。重启后PATH丢失所以我无法调用基本实用程序,因为没有/ usr / bin,/ usr / sbin,/ bin,/ sbin目录都在其中。

因此。我有麻烦了。需要帮助。

1 个答案:

答案 0 :(得分:0)

一些非常基本的东西:

  1. 看起来rvm用于安装ruby。 (你可以在堆栈跟踪的路径中通过rvm告诉)
  2. Bundler失败,显示错误消息Bundler couldn't find some gems. Did you run 'bundle install'?。你有没有运行捆绑安装?您可能需要从/opt/hydra/rails/目录执行此操作,以便rvm将设置必要的环境变量,以便Bundler可以找到hydra的Gemfile。
  3. 是否正在使用bundle exec启动Rails服务器?这将确保捆绑器可以在rails服务器启动时包含Gemfile中的gem。
  4. 您可能没有使用正确的gemset。从堆栈跟踪看起来正在使用global。你有没有办法找出这是否是正确使用的宝石?你可以运行:

    rvm gemset list
    

    显示机器上的gemsets。也许有一个名为hydra或类似的东西?您可以使用以下选择不同的宝石集:

    rvm gemset use <gemset name>
    
  5. 抱歉,我无法提供更多帮助。这些是你可以在没有Ruby或没有宝石的情况下结束的方式,以及可能的修复方法。除此之外,很难从所提供的信息中分辨出来。

    希望有所帮助!