What I did:
I installed rails by mistake to the wrong gemset.
$ rvm use 1.9.3
Using /home/username/.rvm/gems/ruby-1.9.3-p125
$ gem env gemdir
/home/username/.rvm/gems/ruby-1.9.3-p125
$ gem install rails
It should have gone into the global gemset.
$ rvm use 1.9.3
Using /home/username/.rvm/gems/ruby-1.9.3-p125
$ rvm gemset use global
Using ruby-1.9.3-p125 with gemset global
$ gem env gemdir
/home/username/.rvm/gems/ruby-1.9.3-p125@global
$ gem install rails
Questions:
- How can I uninstall the whole list of gems installed with rails as well as rdoc and ri without affecting other gems installed in the same gemset? Can I also clean the
cache/
folder in the same step? - As far as I understood it is best practice to install common gems into the global gemset, while project specific gems will go into the specific gemset of that project. Is that correct?
- By the way, what is the "wrong" gemset under
/home/username/.rvm/gems/ruby-1.9.3-p125
good for anyways?
I am aware of similar questions like these.
- Uninstall Rails 3 with dependencies?
- Uninstalling rails and gems, getting error "cannot uninstall, check 'gem list -d ...'
- How to completely uninstall rails 3.0.0.beta3 and all its dependencies?
- How do I completely uninstall rails, ruby and rubygems?
Though, I do not want to reinstall or update rails. I simply want to remove it from that particular gemset.
Approximation / question 1:
I only found an answer to the first question. Thus, it does not remove rails and its dependencies but all gems. This is what I did following the example given. I left off the name since there is no specific name, as far as I understand.
rvm use 1.9.3
Using /home/username/.rvm/gems/ruby-1.9.3-p125
rvm gemset empty
This removed the files under doc/
and gems/
. However, the cache/
folder is still filled.