从UBUNTU 14.0.4 LTS卸载Ruby时出错

时间:2015-06-11 08:43:59

标签: ruby-on-rails ruby ubuntu ubuntu-14.04 uninstall

我在安装Ruby方面犯了一些错误,现在我尝试卸载它(How to remove ruby from ubuntu),但它发出以下错误。我尝试使用sudo apt-get purge ruby,但仍然无法卸载。它显示未安装ruby,但我检查并确认它已安装在/usr/local/bin/ruby位置。请帮我从我的机器上卸载Ruby和RVM。

$ ruby -v
ruby 1.8.7 (2013-06-27 patchlevel 374) [x86_64-linux]

$ sudo apt-get purge ruby 1.8.7
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Note, selecting 'libhdf5-mpich2-1.8.7' for regex '1.8.7'
Note, selecting 'libhdf5-1.8.7' for regex '1.8.7'
Note, selecting 'libghc-utility-ht-prof-0.0.5.1-87764' for regex '1.8.7'
Note, selecting 'libhdf5-openmpi-1.8.7' for regex '1.8.7'
Note, selecting 'libhdf5-serial-1.8.7' for regex '1.8.7'
Note, selecting 'libghc-utility-ht-dev-0.0.5.1-87764' for regex '1.8.7'
Note, selecting 'libghc-utility-ht-dev' instead of 'libghc-utility-ht-dev-0.0.5.1-87764'
Note, selecting 'libghc-utility-ht-prof' instead of 'libghc-utility-ht-prof-0.0.5.1-87764'
Package 'libhdf5-1.8.7' is not installed, so not removed
Package 'libhdf5-serial-1.8.7' is not installed, so not removed
Package 'libhdf5-mpich2-1.8.7' is not installed, so not removed
Package 'libhdf5-openmpi-1.8.7' is not installed, so not removed
Package 'ruby' is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 567 not upgraded.

3 个答案:

答案 0 :(得分:1)

如果你想完全删除红宝石,

sudo apt-get purge ruby rubygems

或者您可以按照以下步骤操作,

使用它来查明它是什么

$ readlink -f /usr/local/bin/ruby

/usr/local/bin/ruby1.8.7

使用它来找出正在使用的包:

$ dpkg -S /usr/local/bin/ruby1.8.7
ruby1.8: /usr/local/bin/ruby1.8.7

并使用它来安装,

$ apt-get purge ruby1.8.7

答案 1 :(得分:1)

如果您使用的是rvm,则可以使用命令

卸载ruby 1.8.7
rvm unistall 1.8.7

然后使用命令

卸载rvm
rvm implode

答案 2 :(得分:1)

我已从ruby目录中删除了home目录,并按照以下步骤操作...

$ whereis ruby
ruby: /usr/local/bin/ruby /usr/local/lib/ruby

$ ruby -v
ruby 1.8.7 (2013-06-27 patchlevel 374) [x86_64-linux]

$ sudo rm -rf /usr/local/bin/ruby
$ sudo rm -rf /usr/local/lib/ruby
$ ruby -v
bash: /usr/local/bin/ruby: No such file or directory

最后它被卸载了!! 感谢Rick

相关问题