简体   繁体   English

使用Passenger运行多个版本的Ruby / Rails

[英]Running multiple versions of Ruby/Rails using Passenger

I have been looking into running Rails 2.3.11(1.8.7) and Rails 3(Ruby 1.9) in parallel. 我一直在研究并行运行Rails 2.3.11(1.8.7)和Rails 3(Ruby 1.9)。 The Phusion website has the following recommended path: Stanadlone Passenger Phusion网站具有以下推荐路径: Stanadlone Passenger
The other option is to run a separate instance of Apache with mod_rails which hosts the Rails 3. The advantage that I see with this approach is that the new app can be also a standalone app and doesnt need to go via the first app for request routing. 另一个选择是使用托管Rails 3的mod_rails运行一个单独的Apache实例。我看到的这种方法的优点是,新应用程序也可以是独立应用程序,不需要通过第一个应用程序进行请求路由。 That is I can have a url matching reverse proxy which can route requests to Rails 3 or Rails 2. 也就是说,我可以拥有一个URL匹配的反向代理,该代理可以将请求路由到Rails 3或Rails 2。

My questions is which is a better option? 我的问题是哪个更好的选择? Using another Apache with mod_rails to host the second instance or just use a standalone Passenger. 将另一个Apache与mod_rails一起使用来托管第二个实例,或者仅使用独立的Passenger。

As I know it is impossible. 据我所知,这是不可能的。 But you can do it using apache and fcgi. 但是您可以使用apache和fcgi来实现。 Fcgi will not conflict with passenger. Fcgi不会与乘客冲突。 You can even use rvm with fcgi. 您甚至可以将rvm与fcgi一起使用。

Here is example of index.fcgi for fcgi and rvm: 这是fcgi和rvm的index.fcgi示例:

#!/usr/bin/env /home/user/.rvm/bin/ruby-1.9.2-p290

ENV['GEM_HOME'] = '/home/user/.rvm/gems/ruby-1.9.2-p290@app_gemset'
ENV['GEM_PATH'] = '/home/user/.rvm/gems/ruby-1.9.2-p290@app_gemset:/home/user/.rvm/gems/ruby-1.9.2-p290@global'

ENV['RAILS_ENV'] ||= 'production'


require File.join(File.dirname(__FILE__), '../config/environment')


Rack::Handler::FastCGI.run  ...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 为多个Ruby-on-Rails应用程序运行多种版本的Passenger - Running Multiple Versions of Passenger for Multiple Ruby-on-Rails Applications 如何使用Apache / Passenger和多个Ruby版本运行Rails应用 - How to run Rails app using Apache/Passenger with Multiple Ruby versions 使用Passenger部署具有多个Ruby版本的应用程序 - Deploying apps with multiple ruby versions using Passenger 使用乘客运行多个Rails应用程序 - Running multiple rails applications using Passenger 乘客未运行(Ruby on Rails + Nginx) - Passenger not running (Ruby on Rails + Nginx) 使用Passenger for Nginx部署多个Ruby应用程序(Rails和Sinatra)? - Multiple Ruby apps (Rails and Sinatra) deployed using Passenger for Nginx? 使用nusionx使用phusion passenger 3.0.17运行多个rails网站 - running multiple rails websites using phusion passenger 3.0.17 with nginx Phusion乘客和运行多个红宝石版本与阿帕奇 - Phusion passenger and running multiple ruby version with apache 在 IIS 服务器上运行多个内部 ruby​​/rails 应用程序的基础知识 - 这种情况是否需要乘客? - Basics of running multiple internal ruby/rails apps on an IIS server - is something like passenger required for this situation? 使用乘客部署Ruby on Rails应用程序时出错 - Error deploying Ruby on Rails Application using Passenger
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM