Is there a way to create the associated .ruby-version
and .ruby-gemset
files when creating a new gemset?
With older versions of rvm, one could do rvm --create --rvmrc 1.8.7@project
, but that creates .rvmrc
files.
I thought I read somewhere we could use the --ruby-version
command line switch, but I have been unsuccessful in doing so.
I recently had the same problem.
rvm --help
led me to:It created both .ruby-gemset and .ruby-version.
According to the official RVM docs you can use this:
Or you can use this:
The second form will create both
.ruby-version
and.ruby-gemset
.Suppose I am creating gemset for my rails app whose name is tptapp then we can do it in following way.
here tptapp is name of gemset, 2.2.2 is Ruby version.
All of the above examples require you to type in your ruby version and gemset name .. which is close to the same keystrokes required to vi .ruby-gemset and vi .ruby-version. Assuming you are in a directory where you've already chosen your ruby version and you are pointing at the desired gemset.. this does the trick.