使用乘客运行 Rails 3.0 和 Rails 3.1 应用程序(使用不同的 rvm gemset) [英] Using passenger to run both Rails 3.0 and Rails 3.1 app (using different rvm gemsets)

查看:29
本文介绍了使用乘客运行 Rails 3.0 和 Rails 3.1 应用程序(使用不同的 rvm gemset)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只是按照这些说明来安装新的 rvm gemset 和安装 rails-3.1.0.rc2 在我的本地机器上.起初我收到一个乘客错误,说无法加载 rake-0.9.2 gem,但我发现 this 提醒我运行$passenger-install-apache2-module".它安装良好提示我将以下内容添加到我的 Apache 配置文件 (/etc/apache2/httpd.conf):

I just followed these directions for installing a new rvm gemset and installing rails-3.1.0.rc2 on my local machine. At first I was getting a Passenger error saying the rake-0.9.2 gem could not be loaded, but I found this reminding me to run "$ passenger-install-apache2-module". It installed fine prompted me to add the following to my Apache config file (/etc/apache2/httpd.conf):

LoadModule passenger_module /Users/robs/.rvm/gems/ruby-1.9.2-p180@rails-3.1/gems/passenger-3.0.7/ext/apache2/mod_passenger.so
PassengerRoot /Users/robs/.rvm/gems/ruby-1.9.2-p180@rails-3.1/gems/passenger-3.0.7
PassengerRuby /Users/robs/.rvm/wrappers/ruby-1.9.2-p180@rails-3.1/ruby

但是,已经有来自不同 gemset 的三行:

However, there are already three lines there from a different gemset:

LoadModule passenger_module /Users/robs/.rvm/gems/ruby-1.9.2-p180@rails-3.0/gems/passenger-3.0.7/ext/apache2/mod_passenger.so
PassengerRoot /Users/robs/.rvm/gems/ruby-1.9.2-p180@rails-3.0/gems/passenger-3.0.7
PassengerRuby /Users/robs/.rvm/wrappers/ruby-1.9.2-p180@rails-3.0/ruby

如果我将两组行都未注释(@rails-3.1 gemset 是最后一个),然后重新启动 Apache,我的 Rails 3.0 应用程序将无法启动.我发现自己必须注释掉 rails 3.1 gemset 行,重新启动 Apache,然后运行$ rvm use ruby​​-1.9.2-p180@rails.3.0".如果我想运行 Rails 3.1 应用程序,我必须做相反的事情.

If I leave both sets of lines there uncommented (the @rails-3.1 gemset's is last), and restart Apache, my Rails 3.0 app won't start. I find myself having to comment out the rails 3.1 gemset lines, restart Apache, and then run "$ rvm use ruby-1.9.2-p180@rails.3.0". If I want to run the Rails 3.1 app, I have to do the opposite.

有没有办法让两者能够同时运行而无需这些额外的步骤?

Is there a way to have both be able to run at the same time without these extra steps?

推荐答案

这篇文章可能对您有用.

我以它为例,用 nginx 设置了我自己的开发环境.

I used it as an example to setup my own development environment with nginx.

这篇关于使用乘客运行 Rails 3.0 和 Rails 3.1 应用程序(使用不同的 rvm gemset)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆