RVM commands

Useful RVM commands:

1. To set the defult ruby environment using RVM you can use the following comamnd

rvm use 1.9.3 --default # this will set the ruby1.9.2 as default ruby environment

rvm use jruby-1.4.0 --default # this will set the jruby as defult ruby environment

2. If you do not have ruby install on you machine, you can install using following command:

rvm  install ruby-1.8.7-p352 # to install 1.8.7 ruby

rvm  install ruby-1.9.2-head  # to install 1.9.2 ruby

rvm  install jruby-1.6.4  # to install jruby 1.4.2

3. If you want to see all the installed versions in the RVM the use

rvm list

4. How to create a gemset

rvm gemset create< GEMSETNAME>

5. If you want to see list of gemsets

rvm gemset list

6. If you are using gemsets for your projects then you need to make sure that, when you start using project it also set the RVM to use that gemset. There are two ways to do it – either you set the Manually by using commands as mentioned above or create a .rvmrc file in your project which will switch to that Gemset automatically
To create the .rvmrc file go to your project directory and type command:
This will start using the gemset

echo "rvm use 1.9.3@mygemset" >> .rvmrc
OR
If you want to create and use the gemset then use this command:

echo "rvm --create use 1.9.3@mygemset" >> .rvmrc

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Create a website or blog at WordPress.com

Up ↑

%d bloggers like this: