5

I have created a gemset named rails2ruby192 and i have added below code in my .rvmrc file in root directory but it is not loading the gemset.

ruby-1.9.2-p180@rails2ruby192 
Simone Carletti
  • 173,507
  • 49
  • 363
  • 364
persian
  • 91
  • 1
  • 3

3 Answers3

14

RocketR is correct. However, the more 'correct' way would be to:

cd into your project directory and run the command:

rvm --rvmrc --create use 1.9.2-p180@rails2ruby192

in the root directory of your project. This will create an .rvmrc for the project in that directory, create AND use the gemset if it does not already exist.

Also, this method, nor the one you chose, will 'trust' the newly generated .rvmrc file. For that, you will need to do an:

rvm reload

while in that directory, at which time RVM will reload itself, see the .rvmrc and see that it is not trusted and give you the change to review it and trust it. The reason for using the 'rvm reload' command is that it forces a whole slew of things to take place to structure and stabilize the environment for that particular project to include reloading itself, reloading the .rvmrc (to ensure you are using the right pathings and variables for that gemset), checking to see if the .rvmrc is trusted or not, and then giving you the option To trust it. Should you say yes, it will then finish up by loading the selected ruby@gemset completely.

ddd
  • 1,925
  • 12
  • 19
  • I didn't know about `rvm reload`, was always doing `cd .` instead. – RocketR Oct 22 '12 at 10:21
  • can also do ```rvm-restart``` which has been in place since https://github.com/wayneeseguin/rvm/commit/67e6eb09233c543ddf83b6baf02d180e9351c094 (about 4 years ago, this timestamp) – ddd Jan 01 '14 at 15:29
5

To change the trust level to execute .rvmrc file when entering a folder I used

rvm rvmrc {trust,untrust,trusted,load,reset}

As seen in this SO answer

Community
  • 1
  • 1
Dty
  • 12,253
  • 6
  • 43
  • 61
5

Try rvm use ruby-1.9.2-p180@rails2ruby192 instead

RocketR
  • 3,626
  • 2
  • 25
  • 38
  • Also if Dylan is using Bundler he should be careful since currently when looking for the gems it will ignore the @path, resulting in exceptions. – kain Jul 16 '11 at 20:39
  • Bundler has nothing do to with the @gemset part. It does not ignore this. This is the gemset for RVM, and is switched into it before Bundler ever runs. This sets the environment variables that Bundler will look at such as GEM_PATH, GEM_DIR, and MY_RUBY_HOME. (Look at ```rvm info```) Bundler is completely unaware of RVM gemsets. So the comment that it ignores the @path is correct insofar as that it is completely unaware of it. – ddd Oct 17 '12 at 16:41