我有2個版本,使用RVM紅寶石的,我想刪除我的所有的寶石在這個紅寶石version 1.8.7-p302
拆卸寶石錯誤
首先我試過,但我得到了錯誤
➜ ~ gem list | cut -d" " -f1 | xargs gem uninstall -aIx
Successfully uninstalled actionmailer-2.3.5
Successfully uninstalled actionmailer-2.3.18
Successfully uninstalled actionpack-2.3.5
Successfully uninstalled actionpack-2.3.18
Successfully uninstalled activerecord-2.3.5
Successfully uninstalled activerecord-2.3.18
Successfully uninstalled activeresource-2.3.5
Successfully uninstalled activeresource-2.3.18
Successfully uninstalled activesupport-2.3.5
Successfully uninstalled activesupport-2.3.18
Removing bundle
Successfully uninstalled bundler-1.3.5
ERROR: While executing gem ... (Gem::InstallError)
cannot uninstall, check `gem list -d bundler-unload`
然後我試着這也是一個錯誤
➜ ~ gem list --no-version | xargs gem uninstall -aIx
zsh: correct 'gem' to '.gem' [nyae]? n
ERROR: While executing gem ... (Gem::InstallError)
cannot uninstall, check `gem list -d bundler`
我Gemlist:
➜ ~ gem list
*** LOCAL GEMS ***
bundler (1.3.5)
bundler-unload (1.0.1)
declarative_authorization (0.5.1)
fattr (2.2.1)
i18n (0.4.2)
mysql (2.9.1, 2.8.1)
rack (1.1.6, 1.0.1)
rails (2.3.18, 2.3.5)
rake (10.1.0, 0.8.7)
rubygems-bundler (1.2.2)
rush (0.6.8)
rvm (1.11.3.8)
session (3.1.0)
sqlite3 (1.3.8)
更新:
我試圖刪除紅寶石1.8.7,然後安裝它,但寶石依然存在 當我鍵入我得到這個
➜ ~ rvm gemset empty default
Are you SURE you wish to remove the installed gems for gemset 'ruby-1.8.7-p302' (/home/dexter/.rvm/gems/ruby-1.8.7-p302)?
(anything other than 'yes' will cancel) > yes
➜ ~ gem list
*** LOCAL GEMS ***
bundler (1.3.5)
bundler-unload (1.0.1)
rake (10.1.0)
rubygems-bundler (1.2.2)
rvm (1.11.3.8)
➜ ~ gem list --no-version | xargs gem uninstall -aIx
zsh: correct 'gem' to '.gem' [nyae]? n
INFO: gem "bundler" is not installed
INFO: gem "bundler-unload" is not installed
INFO: gem "rake" is not installed
INFO: gem "rubygems-bundler" is not installed
INFO: gem "rvm" is not installed
現在我無法再次安裝導軌!
➜ ~ gem rails -v '2.3.5'
ERROR: While executing gem ... (RuntimeError)
Unknown command rails
我沒有使用寶石! ,我所做的只是安裝一個紅寶石版本1.8.7然後gem install rails -v 2.3.5 –
請參閱我的文章的補充 - 您應該清空默認的gemset。 – 7stud
如果您切換到ruby的版本'$ rvm use 1.8.7-p302',那麼執行'$ rvm gemset list',您會看到該版本的所有gemset。默認和全局gemsets會自動爲您創建。你可能不應該刪除它們。如果您切換到gemset'$ rvm gemset use mygemsA',您可以通過執行'$ gem list'來查看gemset中的所有寶石。這將允許您確認您的所有寶石是否進入了默認的寶石鑲嵌。 – 7stud