加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 运营中心 > Nginx > 正文

ruby-on-rails – 升级Phusion Passenger而无需重新安装Nginx

发布时间:2020-12-13 21:12:47 所属栏目:Nginx 来源:网络整理
导读:是否可以将Phusion Passenger升级到更新的版本(在我的情况下使用Nginx)? 我使用passenger-install-nginx-module安装了Passenger 4.0.0.rc6.我的Nginx配置现在包含 passenger_root /usr/local/lib/ruby/gems/2.0.0/gems/passenger-4.0.rc6;passenger_ruby /u

是否可以将Phusion Passenger升级到更新的版本(在我的情况下使用Nginx)?

我使用passenger-install-nginx-module安装了Passenger 4.0.0.rc6.我的Nginx配置现在包含

passenger_root /usr/local/lib/ruby/gems/2.0.0/gems/passenger-4.0.rc6;
passenger_ruby /usr/local/bin/ruby;

现在我想升级到Passenger 4.0.2.我可以安装gem,但是当我再次运行passenger-install-nginx-module时,它会尝试重新编译并重新安装Nginx. (我认为在我使用–prefix指定的位置已经安装了Nginx会非常聪明)

我试图手动将passenger_root更改为新的Passenger gem位置,但是我在Nginx错误日志中收到以下错误:

2013/05/12 12:30:13 [alert] 14298#0: Unable to start the Phusion Passenger watchdog because its executable (/usr/local/lib/ruby/gems/2.0.0/gems/passenger-4.0.2/agents/PassengerWatchdog) does not exist. This probably means that your Phusion Passenger installation is broken or incomplete,or that your 'passenger_root' directive is set to the wrong value. Please reinstall Phusion Passenger or fix your 'passenger_root' directive,whichever is applicable. (-1: Unknown error)

显然,PassengerWatchdog是在运行passenger-install-nginx-module时构建的.我不想从旧的宝石上复制PassengerWatchdog,因为有些东西可能已经改变了.

那么……在不重新编译和重新安装Nginx(或Apache)的情况下升级Passenger的正确方法是什么?

最佳答案
@ Wukerplank的评论让我走上正轨.我再次运行passenger-install-nginx-module时检查了输出,它说:

Nginx doesn't support loadable modules such as some other web servers do,so in order to install Nginx with Passenger support,it must be recompiled.

Do you want this installer to download,compile and install Nginx for you?

 1. Yes: download,compile and install Nginx for me. (recommended)
    The easiest way to get started. A stock Nginx 1.4.1 with Passenger
    support,but with no other additional third party modules,will be
    installed for you to a directory of your choice.

 2. No: I want to customize my Nginx installation. (for advanced users)
    Choose this if you want to compile Nginx with more third party modules
    besides Passenger,or if you need to pass additional options to Nginx's
    'configure' script. This installer will  1) ask you for the location of
    the Nginx source code,2) run the 'configure' script according to your
    instructions,and  3) run 'make install'.

Whichever you choose,if you already have an existing Nginx configuration file,then it will be preserved.

重要的是,Nginx必须重新编译才能与Passenger一起使用,并保留现有的Nginx配置.

因此升级乘客的正确方法是

>安装新的Passenger gem
>使用与第一次完全相同的参数执行passenger-install-nginx-module(因此编译相同的Nginx版本和模块,它安装在同一目录中等)
>在安装之前,检查它是否显示“欢迎使用Phusion Passenger Nginx模块安装程序,v4.0.2”.最新版本(在我的情况下为4.0.2)
>安装Nginx后,将现有Nginx conf(path / to / nginx / conf / nginx.conf)中的passenger_root更改为指向新的gem版本(只需将旧版本号替换为新版本)
>重新启动Nginx
>利润

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读