如何在Aptana RadRails中使用旧版本的Rails?

时间:2021-07-15 07:18:41

I'm new to Rails development, and I'm trying to figure out how to use an older version of Rails with Apatana's RadRails IDE. I'm trying to help out a friend who has a site built on older version than the one that automatically gets downloaded by RadRails, and I'm pretty sure the two versions wouldn't be compatible (the site is using some pre 2.0 version, not sure of the exact number offhand).

我是Rails开发的新手,我正在试图弄清楚如何使用旧版本的Rails和Apatana的RadRails IDE。我正在尝试帮助一个建立在旧版本上的站点的朋友,而不是由RadRails自动下载的站点,我很确定这两个版本不兼容(该站点使用的是一些pre 2.0版本,不确定随便的确切数字)。

Is there a way to tell RadRails to get and use a specific version of Rails? Or is there something I can do at the command line to change the installed version of Rails? I'm only vaguely familiar with the "gem" package system, but I'm assuming it would involve that.

有没有办法告诉RadRails获取并使用特定版本的Rails?或者我可以在命令行上做些什么来更改已安装的Rails版本?我只是模糊地熟悉“宝石”包装系统,但我认为它会涉及到这一点。

Any help would be much appreciated!

任何帮助将非常感激!

2 个解决方案

#1


2  

Use the Rake task rails:freeze:gems in your rails project and give it the version you want to use. For example:

在rails项目中使用Rake任务rails:freeze:gems并为其指定要使用的版本。例如:

rake rails:freeze:gems VERSION=2.1.0

That will put the right version of Rails into vendor/rails, which is loaded by default if it exists.

这将把正确版本的Rails放入供应商/ rails,如果存在则默认加载。

#2


1  

If you don't want to freeze the gem into your project (using rake rails:freeze:gems), you can install the rails gem of the version you want to use:

如果你不想将gem冻结到你的项目中(使用rake rails:freeze:gems),你可以安装你想要使用的版本的rails gem:

gem install rails -v 2.0.2

gem install rails -v 2.0.2

and then specify the rails gem to use in your config/environment.rb:

然后指定要在config / environment.rb中使用的rails gem:

RAILS_GEM_VERSION = '2.0.2'

RAILS_GEM_VERSION ='2.0.2'

#1


2  

Use the Rake task rails:freeze:gems in your rails project and give it the version you want to use. For example:

在rails项目中使用Rake任务rails:freeze:gems并为其指定要使用的版本。例如:

rake rails:freeze:gems VERSION=2.1.0

That will put the right version of Rails into vendor/rails, which is loaded by default if it exists.

这将把正确版本的Rails放入供应商/ rails,如果存在则默认加载。

#2


1  

If you don't want to freeze the gem into your project (using rake rails:freeze:gems), you can install the rails gem of the version you want to use:

如果你不想将gem冻结到你的项目中(使用rake rails:freeze:gems),你可以安装你想要使用的版本的rails gem:

gem install rails -v 2.0.2

gem install rails -v 2.0.2

and then specify the rails gem to use in your config/environment.rb:

然后指定要在config / environment.rb中使用的rails gem:

RAILS_GEM_VERSION = '2.0.2'

RAILS_GEM_VERSION ='2.0.2'