3

我分别在 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

正如
乘客安装apache2模块所建议的那样

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

<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。

所以,我的问题是,我怎样才能同时运行我的两个应用程序。

4

2 回答 2

8

乘客 4 允许PassengerRuby根据应用程序进行设置。

最终版本即将发布,但同时您可以通过gem install passenger --pre.

于 2013-03-05T16:16:01.150 回答
1

您不能在单个 phussion 乘客配置中同时运行多个 ruby​​ 版本。如果是这种情况,那么应该使用独立服务器运行(假设在端口 4000 上),并且您应该将 apache 配置为在该端口上作为代理运行。有关更多信息,请参阅http://blog.phusion.nl/2010/09/21/phusion-passenger-running-multiple-ruby-versions/

于 2013-02-01T10:42:10.423 回答