简体   繁体   English

无法启动Phusion Passenger看门狗?

[英]Unable to start the Phusion Passenger watchdog?

I have done a Phusion Passenger setup on Ubuntu 10.04, with Apache2. 我在Ubuntu 10.04上使用Apache2完成了Phusion Passenger设置。 Whenever I restart the Apache server I got the following error message, and the Rails application is not running. 每当我重新启动Apache服务器时,我收到以下错误消息,并且Rails应用程序未运行。

[error] *** Passenger could not be initialized because of this error: Unable to start the Phusion Passenger watchdog because its executable (/usr/lib/phusion-passenger/agents/PassengerWatchdog) does not exist. This probably means that your Phusion Passenger installation is broken or incomplete, or that your 'PassengerRoot' directive is set to the wrong value. Please reinstall Phusion Passenger or fix your 'PassengerRoot' directive, whichever is applicable.

I ran into the same problem when compiling from source, but it was intermittent, which was really frustrating (I think it has to w/ Rails environments). 从源代码编译时我遇到了同样的问题,但它是间歇性的,这真的令人沮丧(我认为它必须w / Rails环境)。 We couldn't use the passenger-install-apache2-module/passenger-install-nginx-module scripts, because we needed a customized nginx installation. 我们无法使用passenger-install-apache2-module / passenger-install-nginx-module脚本,因为我们需要一个自定义的nginx安装。

I finally fixed the problem by going to whatever the passenger-config --root is, then running: rake nginx . 我终于解决了这个问题,去了passenger-config --root是什么,然后运行: rake nginx

Update February 2016 (by Passenger author): 2016年2月更新(乘客作者):

The officially supported method to compile PassengerAgent (without also compiling Nginx, as passenger-install-nginx-module does) is with this command: 官方支持的编译PassengerAgent的方法(没有编译Nginx,就像passenger-install-nginx-module那样)是用这个命令:

passenger-config compile-agent

Passenger 5.0.26 and later will automatically detect the error described in this StackOverflow question, and will automatically suggest running the above command. Passenger 5.0.26及更高版本将自动检测此StackOverflow问题中描述的错误,并将自动建议运行上述命令。

I've just hit this error myself and struggled to find a good answer, so here's my writeup. 我自己刚刚遇到这个错误并且很难找到一个好的答案,所以这是我的写作。 In my setup I'm going for Ubuntu, Apache2, the latest Passenger and Rails 2.3. 在我的设置中,我将使用Ubuntu,Apache2,最新的Passenger和Rails 2.3。

  1. Install Ruby and Rubygems NB: make (very) sure your gem -v is correct, if it's wrong you'll do all this twice 安装Ruby和Rubygems注意:make(非常)确定你的gem -v是正确的,如果它错了你会做两次这两次
  2. sudo gem install passenger
  3. cd /usr/lib
  4. wget http://rubyforge.org/frs/download.php/76005/passenger-3.0.12.tar.gz
  5. tar zxvf passenger-3.0.12.tar.gz
  6. cd passenger-3.0.12
  7. ./bin/passenger-install-apache2-module
  8. Add export PATH=/var/lib/gems/1.8/bin:$PATH to ~/.bashrc export PATH=/var/lib/gems/1.8/bin:$PATH到〜/ .bashrc
  9. ln -s /usr/lib/passenger-3.0.12 /usr/share/phusion-passenger # => this fixes a world of hurt to do with PassengerWatchdog. ln -s /usr/lib/passenger-3.0.12 /usr/share/phusion-passenger #=>这解决了与PassengerWatchdog有关的伤害世界。 NB: PassengerWatchdog doesn't come down with apt-get which is why we grabbed the binaries. 注意:PassengerWatchdog没有使用apt-get,这就是我们抓住二进制文件的原因。
  10. ln -s /usr/lib/passenger-3.0.12 /usr/lib/phusion-passenger # => similar issues. ln -s /usr/lib/passenger-3.0.12 /usr/lib/phusion-passenger #=>类似的问题。

This is from memory following thrashing it through for the last day and a half, I'll tidy up when I have to go through it again. 这是在最后一天半的时间里通过记忆而来的记忆,当我必须再次通过它时,我会整理一下。

Try to install passenger module by running script passenger-install-apache2-module . 尝试通过运行脚本passenger-install-apache2-module安装乘客模块。 I had same problem but on nginx; 我有同样的问题,但在nginx; I installed passenger via gem and then recompiled nginx manually with passenger module - this caused error described by you. 我通过gem安装了乘客,然后用乘客模块手动重新编译了nginx - 这导致了您所描述的错误。 After running passenger-install-nginx-module such error disappeared. 运行passenger-install-nginx-module后,这样的错误就消失了。

It had been a while since I had restarted nginx and in the meantime the path to passenger had changed. 自从我重新启动nginx以来已经有一段时间了,与此同时,乘客的路径发生了变化。 I looked in the nginx.conf to see what the passenger_root was set to and realized that it was the old value: 我查看了nginx.conf以查看passenger_root设置,并意识到这是旧值:

http {
    passenger_root /home/nginx/rails_app/myapp/shared/bundle/ruby/1.9.1/gems/passenger-enterprise-server-3.0.17;

There are often two places to change: 通常有两个地方需要改变:

server {
    listen 8888;
    root /home/nginx/rails_app/myapp/current/public;

I restarted nginx and the error was gone. 我重新启动了nginx,错误消失了。

I had the same issue on my Nginx-Server. 我在Nginx-Server上遇到了同样的问题。
In my case, the passenger_root directory was not correct, because of gem update. 就我而言,由于gem更新, passenger_root目录不正确。

[1] On Linux, i searched the passenger Directory with the following Command: [1]在Linux上,我使用以下命令搜索了乘客目录:

find / -name PassengerWatchdog

[2] Now i changed my 'passenger_root' Value to this Directory. [2]现在我将'passenger_root'值更改为此目录。
[3] And restart the Server. [3]然后重启服务器。

suvankar, Maybe you should change your Passenger Path too. suvankar,也许你应该改变你的乘客路径。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM