If you are using rvm and want to load project specific ruby version and gems automatically when you access the project directory, for this you can use a very simple command
rvm --create --ruby-version use ruby-version-number@gemsetname
example
rvm --create --ruby-version use ruby-2.2.0@findnerd
If you want the gems to be loaded from the global gemset then in that case
rvm --create --ruby-version use ruby-2.2.0
By using this command you wont have to use rvm command to load a particular gemset or ruby version and you can manage different projects running on different ruby and rails version simultaneously.
Behind the scenes
It basically creates two files -
1 - A .ruby-version file that contains the required ruby version "ruby-2.2.0"
2 - A .ruby-gemset file that contains gemset name in this case "findnerd".
which basically tells rvm to load the required configuration.
I hope this helps anyone trying to cope up with multiple versions of ruby,rails or gem versions.
0 Comment(s)