乘客加载错误 - 无法加载此类文件 - phusion_passenger(LoadError)

时间:2014-11-21 09:57:27

标签: ruby-on-rails ruby apache passenger

我们在运行Apache(2.4.6)+ Passenger + Rails 4.0.0的虚拟服务器上有两个应用程序。

我们的服务器出现了问题,因为ruby进程占用了100%的CPU。重新启动服务器后,ruby进程不再运行,但乘客也没有启动。

运行乘客状态我们收到错误:

/home/adm/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- phusion_passenger (LoadError)
from /home/adm/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /usr/sbin/passenger-status:27:in `<main>'

我对乘客不太专业,所以我不知道发生了什么。

有什么建议吗?甚至要了解真正的问题是什么。

提前谢谢

修改

正在运行bundle show passenger

输出Could not find gem passenger

PAssenger由apache加载到应用程序的虚拟主机中:

<VirtualHost *:80>
        ServerName www.site1.it 
    ServerAlias site1.it       
    DocumentRoot /var/www/proj/current/public


    LoadModule passenger_module /home/adm/.rvm/gems/ruby-2.1.0@dentist/gems/passenger-4.0.37/buildout/apache2/mod_passenger.so
    <IfModule mod_passenger.c>
        PassengerRoot /home/adm/.rvm/gems/ruby-2.1.0@dentist/gems/passenger-4.0.37
        PassengerDefaultRuby /home/adm/.rvm/gems/ruby-2.1.0@dentist/wrappers/ruby
    </IfModule>

        RailsEnv production
        PassengerLogLevel 3
        PassengerMinInstances 1
        <Directory /var/www/proj/current/public>

                # This relaxes Apache security settings.
                AllowOverride all
                # MultiViews must be turned off.
                Options -MultiViews
        </Directory>
</VirtualHost>

<VirtualHost *:80>
        ServerName www.site2.it 
    ServerAlias site2.it       
    DocumentRoot /var/www/proj/current/public

    RequestHeader Set X-Sendfile-Type X-Sendfile
    XSendFile On

    LoadModule passenger_module /home/adm/.rvm/gems/ruby-2.1.0@police/gems/passenger-4.0.37/buildout/apache2/mod_passenger.so
    <IfModule mod_passenger.c>
          PassengerRoot /home/adm/.rvm/gems/ruby-2.1.0@police/gems/passenger-4.0.37
          PassengerDefaultRuby /home/adm/.rvm/gems/ruby-2.1.0@police/wrappers/ruby
        </IfModule>

        RailsEnv production
        PassengerLogLevel 3
        PassengerMinInstances 1
        <Directory /var/www/proj/current/public>

                # This relaxes Apache security settings.
                AllowOverride all
                # MultiViews must be turned off.
                Options -MultiViews
        </Directory>
</VirtualHost>

1 个答案:

答案 0 :(得分:0)

这是我在apache error.log中找到的内容

An error occurred while starting up the preloader: it did not write a startup response in time. Please read <a href="https://github.com/phusion/passenger/wiki/Debugging-application-startup-problems">this article</a> for more information about this problem.<br>

所以我将PassengerStartTimeout 300添加到我的apache配置文件中,即使非常慢,它也会重新开始工作。 ruby过程的问题仍然存在,但我会问另一个问题。