How do I rename a gemset?

RubyRvm

Ruby Problem Overview


Is there an RVM command to simply rename a gemset? I couldn't find it on the RVM site.

Ruby Solutions


Solution 1 - Ruby

There is an RVM gemset rename command. I'm not sure when it was introduced but it is present in 1.0.16.

rvm gemset rename current_gemset_name new_gemset_name

As of RVM 1.21 or higher it will automatically switch you to the newly renamed gemset.

If you are on an older version of RVM you'll also need to switch to the newly created gemset, as follows:

rvm gemset use new_gemset_name

Running the command rvm gemset list will tell you the current gemset you are operating within.

Solution 2 - Ruby

I copied one with

rvm gemset copy <gemset_from> <gemset_dest>

and then deleted the previous one with

rvm gemset delete <gemset_from> 

Solution 3 - Ruby

Solution 4 - Ruby

If you get the error that your gemset doesn't exist, but it exist you have to chose appropriate ruby version!

For example, if you have gemset ree@something-x and you current rvm (rvm current) is ruby-1.9.3-p194 then you have to execute

rvm use ree

and then

rvm gemset rename something-x something-y

It works with rvm version 1.16.17

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionJason GalvinView Question on Stackoverflow
Solution 1 - RubypakehaView Answer on Stackoverflow
Solution 2 - RubyDanielGView Answer on Stackoverflow
Solution 3 - RubyFernando KoshView Answer on Stackoverflow
Solution 4 - RubyZeke FastView Answer on Stackoverflow