微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

ruby-on-rails – 升级Phusion Passenger而无需重新安装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 /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>利润

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐