Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

RVM .ruby-gemset file does not switch gemsets

Tags:

rvm

gemset

Why doesn't rvm switch to @project_gemset when I cd into my project's directory? The gemset name in my .ruby-gemset file matches the name listed from rvm gemset list.

> cd project
> ls -A
.ruby-gemset
> cat .ruby-gemset
project_gemset
> rvm gemset list

gemsets for ruby-1.9.3-p392 (found in /Users/david/.rvm/gems/ruby-1.9.3-p392)
=> (default)
   global
   project_gemset
like image 460
David Winiecki Avatar asked May 31 '13 22:05

David Winiecki


People also ask

How do I add Gemset to 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 use Gemset?

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. Each project need only worry about its own gems. RVM provides (>= 0.1.

How do I delete Gemset rvm?

You need to specify the gemset you want to empty. It's not enough just to "rvm use [gemset_name]". You need to "rvm gemset empty [gemset_name]". I suppose if you have many gems, it could take a while to uninstall them all.

How do I find my Gemset?

However, to see the contents of a gemset, excluding the @global gemset, first do rvm use 2.0.0@some-gemset --ignore-gemsets (or similar for other Rubies) then gem list . Similarly to see the contents of the @global gemset, first do rvm use 2.0.0@global then gem list .


1 Answers

It seems you must have both a valid .ruby-version file and a .ruby-gemset file in order for rvm to make the switch.

I was hoping it would switch gemsets and use the default ruby version, since the gemset is one of the existing gemsets for my default ruby. But that's not how it works.

like image 82
David Winiecki Avatar answered Nov 09 '22 05:11

David Winiecki