gpt4 book ai didi

ruby-on-rails - Phusion 乘客并使用 apache 运行多个 ruby​​ 版本

转载 作者:行者123 更新时间:2023-12-04 07:37:27 25 4
gpt4 key购买 nike

我在 ruby​​ 1.8.x 和 ruby​​ 1.9.11 上分别建立了两个不同的 Rails 网站。我已经使用以下代码行配置了我的/etc/httpd/conf/http.conf:

LoadModule passenger_module /opt/ruby-enterprise-1.8.7-2012.02/lib/ruby/gems/1.8/gems/passenger-3.0.18/ext/apache2/mod_passenger.so
PassengerRoot /opt/ruby-enterprise-1.8.7-2012.02/lib/ruby/gems/1.8/gems/passenger-3.0.18
PassengerRuby /opt/ruby-enterprise-1.8.7-2012.02/bin/ruby

按照
的建议 passenger-install-apache2-module

同样,我还添加了替换替代品的进一步必要代码:

<VirtualHost *:80>
ServerName www.example.com
# !!! Be sure to point DocumentRoot to 'public'!
DocumentRoot /somewhere/public
<Directory /somewhere/public>
# This relaxes Apache security settings.
AllowOverride all
# MultiViews must be turned off.
Options -MultiViews
</Directory>
</VirtualHost>

到目前为止一切正常,但是当我尝试为 ruby​​ 1.9.3 应用程序添加另一个配置并遵循上述相同的过程时,我无法同时运行 ruby​​ 1.8.7 应用程序和 1.9.3 应用程序.后者运行成功,而前者产生错误。

我使用 rvm 来管理这两个应用程序,并为每个应用程序提供单独的 gemset。

所以,我的问题是,如何同时运行我的两个应用程序。

最佳答案

Passenger 4 允许为每个应用程序设置 PassengerRuby

最终版本即将发布,但同时您可以通过 gem installpassenger --pre 安装它。

关于ruby-on-rails - Phusion 乘客并使用 apache 运行多个 ruby​​ 版本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14643815/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com