How do you uninstall RVM gem?

2019-06-20 17:16发布

问题:

Strange... but this is what I got :

$ gem list | grep rvm
>> rvm (1.11.3.3)
$ gem uninstall rvm
>> INFO:  gem "rvm" is not installed

How can that be possible? The root of this problem probably stems from me downloading the latest RVM and finding that it does not work with the latest version of POW. Thus I had to implode RVM and reinstall an older version. Since then when I do a cap deploy, I get the classic :

`<top (required)>': RVM - Capistrano integration was extracted to a separate gem, install: `gem install rvm-capistrano` and remove the `$LOAD_PATH.unshift` line, note also the 'set :rvm_type, :user' is now the default (instead of :system). (RuntimeError)

Any ideas?

回答1:

Are you in a gemset? If so, that gem might be in the interpreter's unnamed gemset or the global gemset. If so, try

rvm use 1.9.3
gem uninstall rvm

or

rvm use 1.9.3@global
gem uninstall rvm


回答2:

I recently encountered the same rvm error:

"RVM - Capistrano integration was extracted to a separate gem, install: gem install rvm-capistrano and remove the $LOAD_PATH.unshift line, note also the 'set :rvm_type, :user' is now the default (instead of :system). (RuntimeError)"

Doing what the error suggested did not work for me at all.

What did work for me was to do: rvm -v

When I did this I saw that my rvm version was rvm 1.13.0

Using "rvm get" I did "rvm get 1.12.0" but still got the error

Then I tried "rvm get 1.11.0" and then presto, my rvm started working again.

I'm not 100% sure what caused the error in the first place but I think it all began when I tried to upgrade rvm with rvm get stable after I was unable to install some gems. I found out that I wasn't able to install gems anymore due to the fact that I had updated my xcode to 4.3.2 and apparently Apple changed their c complier which doesn't play nice with rvm.

Hope this helps someone.



回答3:

I just ran into this error as well. The error you ran into was because of the recent capistrano update. If you add rvm-capistrano to your gemfile and remove the $LOAD-PATH.unshift line from your capistrano deployment file it should work, at least it did for me.



回答4:

That would be correct. Its in the 'global' gemset. This gemset is 'mixed in' to both the 'default' gemset and any gemsets you actually create.

Thus if you have Ruby 1.9.3 installed, for example, (rvm install 1.9.3) it will be installed into that ruby's 'global'. You can verify this by doing 'gem list rvm -dl' which will show you the name, version, description, and location on the disk of the requested gem.

∴ gem list rvm -dl

*** LOCAL GEMS ***

rvm (1.11.3.3)
    Authors: Wayne E. Seguin, Michal Papis
    Homepage: https://rvm.beginrescueend.com/
    Installed at: /home/me/.rvm/gems/ruby-1.9.3-p194@global

    RVM Ruby Gem Library
∴

I don't know why you want it removed, but you would do as Abe stated as the second choice.



回答5:

To give more details, RVM works with POW, this is known issue: https://github.com/37signals/pow/issues/271

the easiest solution(in project dir):

rvm env . > .powenv


回答6:

The version of RVM might not be compatible with POW. You can remove RVM and then install the most current version.



回答7:

The problem is that RVM 1.12 and up does not play well with Capistrano. So uninstall your RVM, then get RVM 1.11 (rvm get 1.11.0).



回答8:

Nathan got it right: https://stackoverflow.com/a/10306090/294449

You used to have to do the unshift in your deploy.rb but the latest versions of RVM have made that hack no longer necessary. Just remove it and add the rvm-capistrano gem to your Gemfile. It works like a charm.