RVM: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
|||
Line 27: | Line 27: | ||
Now when you <code>cd</code> to the <code>my_project</code> directory, your ruby and gemset will change automatically: | Now when you <code>cd</code> to the <code>my_project</code> directory, your ruby and gemset will change automatically: | ||
<pre> | <pre> | ||
cd ~/projects/ | cd ~/projects/my_project | ||
[ruby-1.9.1-p243] (0) $ ruby -v | [ruby-1.9.1-p243] (0) $ ruby -v | ||
ruby 1.9.1p243 (2009-07-16 revision 24175) [i686-darwin10.2.0] | ruby 1.9.1p243 (2009-07-16 revision 24175) [i686-darwin10.2.0] | ||
[ruby-1.9.1-p243] (0) $ gem env gemdir | [ruby-1.9.1-p243] (0) $ gem env gemdir | ||
/Users/wayne/.rvm/gems/ruby/1.9.1@ | /Users/wayne/.rvm/gems/ruby/1.9.1@my_project | ||
</pre> | </pre> |
Revision as of 18:08, 10 July 2012
Ruby Version Manager
http://cheat.errtheblog.com/s/rvm/
https://rvm.io//rvm/best-practices/
To create a new gemset:
rvm ruby-1.9.3-p194@rails2314 --create
To switch to a particular gemset:
rvm gemset use rails2314
Now you can use gem
to install the needed gems.
May need to source /etc/profile.d/rvm.sh
to get things working.
Project Setup and Best Practices
https://rvm.io/workflow/rvmrc/
cd ~/projects/my_project/ rvm --rvmrc --create 1.9.1@my_project
Now when you cd
to the my_project
directory, your ruby and gemset will change automatically:
cd ~/projects/my_project [ruby-1.9.1-p243] (0) $ ruby -v ruby 1.9.1p243 (2009-07-16 revision 24175) [i686-darwin10.2.0] [ruby-1.9.1-p243] (0) $ gem env gemdir /Users/wayne/.rvm/gems/ruby/1.9.1@my_project