简体   繁体   English

我可以在同一服务器上运行Rails 2和Rails 3应用程序吗?

[英]Can I run a Rails 2 and a Rails 3 applications on the same server?

I'm trying to figure out if I can run on the same server(I have an AWS running with ubuntu) a Rails 2 and a Rails 3 applications? 我正在尝试确定是否可以在同一服务器上运行(我的AWS在Ubuntu上运行),Rails 2和Rails 3应用程序?

Is this possible? 这可能吗? Or I'm just dreaming? 还是我只是在做梦?

Thanks people. 谢谢大家

Yes, it's possible. 是的,有可能。 Ruby and RubyGems are designed to install and run different version of the same Gem on the same server and Rails it's nothing more than a Gem. Ruby和RubyGems旨在在同一服务器和Rails上安装和运行同一Gem的不同版本,这无非是Gem。

My suggestion is to use Bundler to isolate Gem dependencies and Rails versions. 我的建议是使用Bundler隔离Gem依赖项和Rails版本。 It's quite easy to do, Rails 3 uses Bundler by default. 这很容易做到,Rails 3默认使用Bundler。 You can use Bunder with Rails 2.3 as well. 您也可以将Bunder与Rails 2.3一起使用。 The instructions are on the Bundler website. 说明在Bundler网站上。

When you deploy your project, Bundler will install the necessary dependencies and you'll be able to run two or more projects with several different versions of Rails on the same machine. 部署项目时,Bundler将安装必要的依赖项,并且您将能够在同一台计算机上运行具有多个不同版本的Rails的两个或多个项目。

Yes it is possible. 对的,这是可能的。 You need a Ruby Version Manager: https://rvm.io/ 您需要一个Ruby版本管理器: https : //rvm.io/

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM