开发者

How can I use multiple versions of rails in the same machine

I have installed rails 3.0.10 and 2.3.5 in my machine. I wanna shuffle between them but I am unable to use 2.3开发者_开发百科.5. When I run a command, the system recognizes only 3.0.10.


rvm lets you easily manage multiple installs of Ruby, each with their own list of gemsets.

Edit: Based on your comment about looking into gemsets, I'll point out one of the single coolest features with rvm. Once you get your gemset setup, create a .rvmrc file in your Rails root directory. Add the following to it:

rvm 1.9.2@foo

Where "1.9.2" is whatever Ruby you're using and "foo" is the gemset name. rvm will automatically start using this set when you cd in to that directory.


Definitely use rvm, create a .rvmrc file in the root directory of each of your projects.

For rails 3 stuff, it should contain a single line: rvm 1.9.2@projectName

Replacing projectName with an identifier for your project. Then use rvm gemset create projectName

Everytime you go into that directory, you'll be using that version of ruby with that particular gemset so you won't mix up versions or ruby or gems!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜