Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to make a gemset in RVM the default?

I'm trying to make a gemset the default whenever I start a new terminal in Mac OS X:

rvm use [email protected] --create --default 

That seems to work, the rails3.2 gemset becomes the current gemset:

$ rvm gemset list  gemsets for ruby-1.9.3-p0 (found in /Users/me/.rvm/gems/ruby-1.9.3-p0)    global => rails3.2  $ 

But when I open up a new terminal, the rails3.2 gemset is no longer the current:

$ rvm gemset list  gemsets for ruby-1.9.3-p0 (found in /Users/me/.rvm/gems/ruby-1.9.3-p0)    global    rails3.2  $ 

What do I do?

like image 546
at. Avatar asked Feb 14 '12 18:02

at.


People also ask

How do I create a Gemset in RVM?

Step 1: rvm gemset create [name of gemset] Step 2: rvm --rvmrc [ruby version here]@[name of gemset] # Note: You can check your current ruby version by running "ruby -v" from your console. Step 3: Refresh your directory. # You can simply do this by checking out of your directory and going back to that directory again.

How do I remove Gemset from RVM?

You need to "rvm gemset empty [gemset_name]". I suppose if you have many gems, it could take a while to uninstall them all. Incidentally right now I am able to run rvm gemset empty and it clears the current gemset.

What is Gemset in RVM?

If you are using RVM(Ruby Version Manager) then using a gemset for each project is a good idea. A gemset is just a container you can use to keep gems separate from each other. Creating a gemset per project allows you to change gems (and gem versions) for one project without breaking all your other projects.


2 Answers

Have you tried specifying rvm --default use after the gemset is created so passing:

 rvm --default use [email protected] 

and then seeing if that sticks? Using create and default at the same time isn't something I've tried before, it's the only thing that strikes me as out of place.

Given the discussion below I'd offer this as a means for dealing with the problem. (Personally, I'd probably implode rvm and start over.) But, if you wanted to try to make a go of it with this install then I'd look at your .rvm folder, specifically in .rvm/environments/default which will contain all the environment variables exported for the default environment. Here you'll find rvm_gemset_name this may be set incorrectly and isn't updated for some reason (permissions?) or is set correctly in which case its some other environment issue. You could try manually setting it here in the file if its not correct.

like image 56
Mike K. Avatar answered Sep 19 '22 11:09

Mike K.


You can use this command.

rvm use --default <ruby version>@<gemset name> 

or

rvm --default use <ruby version>@<gemset name> or

rvm use <ruby version>@<gemset name> --default  
like image 21
Amrit Dhungana Avatar answered Sep 20 '22 11:09

Amrit Dhungana