Ruby-on-rails 无法启动 Phusion 乘客看门狗?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/9426666/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-03 02:53:14  来源:igfitidea点击:

Unable to start the Phusion Passenger watchdog?

ruby-on-railsapache2passenger

提问by suvankar

I have done a Phusion Passenger setup on Ubuntu 10.04, with Apache2. Whenever I restart the Apache server I got the following error message, and the Rails application is not running.

我在 Ubuntu 10.04 上使用 Apache2 完成了 Phusion 乘客设置。每当我重新启动 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.

回答by dylst

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). We couldn't use the passenger-install-apache2-module/passenger-install-nginx-module scripts, because we needed a customized nginx installation.

我在从源代码编译时遇到了同样的问题,但它是间歇性的,这真的很令人沮丧(我认为它必须使用 Rails 环境)。我们不能使用passenger-install-apache2-module/passenger-install-nginx-module 脚本,因为我们需要一个定制的nginx 安装。

I finally fixed the problem by going to whatever the passenger-config --rootis, 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 问题中描述的错误,并会自动建议运行上述命令。

回答by TomDunning

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 -vis correct, if it's wrong you'll do all this twice
  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:$PATHto ~/.bashrc
  9. ln -s /usr/lib/passenger-3.0.12 /usr/share/phusion-passenger# => this fixes a world of hurt to do with PassengerWatchdog. NB: PassengerWatchdog doesn't come down with apt-get which is why we grabbed the binaries.
  10. ln -s /usr/lib/passenger-3.0.12 /usr/lib/phusion-passenger# => similar issues.
  1. 安装 Ruby 和 Rubygems NB:(非常)确保你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. 添加export PATH=/var/lib/gems/1.8/bin:$PATH到 ~/.bashrc
  9. ln -s /usr/lib/passenger-3.0.12 /usr/share/phusion-passenger# => 这修复了与PassengerWatchdog有关的伤害世界。注意:PassengerWatchdog 没有使用 apt-get,这就是我们获取二进制文件的原因。
  10. 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.

这是折腾了一天半后的记忆,有空再去整理一下。

回答by Piotr

Try to install passenger module by running script passenger-install-apache2-module . I had same problem but on nginx; I installed passenger via gem and then recompiled nginx manually with passenger module - this caused error described by you. After running passenger-install-nginx-module such error disappeared.

尝试通过运行脚本passenger-install-apache2-module 来安装passenger 模块。我有同样的问题,但在 nginx 上;我通过 gem 安装了乘客,然后使用乘客模块手动重新编译了 nginx - 这导致了您描述的错误。运行passenger-install-nginx-module后,这样的错误消失了。

回答by Kevin Trotter

It had been a while since I had restarted nginx and in the meantime the path to passenger had changed. I looked in the nginx.confto see what the passenger_rootwas set to and realized that it was the old value:

自从我重新启动 nginx 以来已经有一段时间了,与此同时,通向乘客的路径发生了变化。我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,错误消失了。

回答by stephanfriedrich

I had the same issue on my Nginx-Server.
In my case, the passenger_rootdirectory was not correct, because of gem update.

我在我的 Nginx 服务器上遇到了同样的问题。
就我而言,passenger_root由于 gem 更新,目录不正确。

[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.
[3] And restart the Server.

[2] 现在我将我的 'passenger_root' 值更改为该目录。
[3] 并重启服务器。

suvankar, Maybe you should change your Passenger Path too.

suvankar,也许你也应该改变你的乘客路径。