如何在 ubuntu 上卸载 Ruby?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/3957730/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-02 23:24:58  来源:igfitidea点击:

How can I uninstall Ruby on ubuntu?

ruby-on-railsrubyubuntuuninstall

提问by khanh

How can I uninstall Ruby 1.9.2dev (2010-07-02) [i486-linux] on ubuntu? Need to reinstall - please help

如何在 ubuntu 上卸载 Ruby 1.9.2dev (2010-07-02) [i486-linux]?需要重新安装 - 请帮忙

回答by jwueller

This command should do the trick (provided that you installed it using a dpkg-based packet manager):

此命令应该可以解决问题(前提是您使用基于 dpkg 的数据包管理器安装了它):

aptitude purge ruby

回答by theamoeba

Run the following command from your terminal:

从终端运行以下命令:

sudo apt-get purge ruby

sudo apt-get purge ruby

Usually works well for me.

通常对我来说效果很好。

回答by regmiprem

At first find out where ruby is? then

首先找出ruby在哪里?然后

rm -rf /usr/local/lib/ruby
rm -rf /usr/lib/ruby
rm -f /usr/local/bin/ruby
rm -f /usr/bin/ruby
rm -f /usr/local/bin/irb
rm -f /usr/bin/irb
rm -f /usr/local/bin/gem
rm -f /usr/bin/gem

回答by shellbye

I have tried many include sudo apt-get purge ruby, sudo apt-get remove rubyand sudo aptitude purpe ruby, both with and without '*' at the end. But none of them worked, it's may be I've installed more than one version ruby.

我尝试了很多 include sudo apt-get purge ruby, sudo apt-get remove rubyand sudo aptitude purpe ruby,最后都有和没有 '*' 。但是它们都不起作用,可能是我安装了多个版本的 ruby​​。

Finally, when I triedsudo apt-get purge ruby1.9(with the version), then it works.

最后,当我尝试sudo apt-get purge ruby1.9(使用版本)时,它起作用了。

回答by Travis

Here is what sudo apt-get purge ruby*removed relating to GRUBfor me:

以下是sudo apt-get purge ruby*GRUB我相关的删除内容:

grub-pc 
grub-gfxpayload-lists
grub2-common
grub-pc-bin 
grub-common 

回答by mminski

Run the following command on the terminal:

在终端上运行以下命令:

sudo apt-get autoremove ruby

回答by Alistair

On Lubuntu, I just tried apt-get purge ruby* and as well as removing ruby, it looks like this command tried to remove various things to do with GRUB, which is a bit worrying for next time I want to reboot my computer. I can't yet say if any damage has really been done.

在 Lubuntu 上,我只是尝试了 apt-get purge ruby​​ 以及删除 ruby​​,看起来这个命令试图删除与 GRUB 相关的各种事情,这对于下次我想重新启动计算机时有点担心。我还不能说是否真的造成了任何损害。

回答by Aboozar Rajabi

If you used rbenvto install it, you can use

如果你曾经rbenv安装过它,你可以使用

rbenv versions 

to see which versions you have installed.

查看您安装了哪些版本。

Then, use the uninstall command:

然后,使用卸载命令:

rbenv uninstall [-f|--force] <version>

for example:

例如:

rbenv uninstall 2.4.0  # Uninstall Ruby 2.4.0

If you installed Rails, it will be removed, too.

如果您安装了 Rails,它也会被删除。

回答by Nataraja B

Why you are removing old version of the ruby?

为什么要删除旧版本的 ruby​​?

rvm install 2.4.2 // version of ruby u need to insatll rvm use 2.4.2 --default // set ruby version you want use by default

rvm install 2.4.2 // ruby​​ 版本你需要安装 rvm use 2.4.2 --default // 设置你想要默认使用的 ruby​​ 版本

Using rvm you can install multiple ruby version in the system

使用 rvm 您可以在系统中安装多个 ruby​​ 版本

Please follow below steps install ruby using rvm

请按照以下步骤使用 rvm 安装 ruby

sudo apt-get install libgdbm-dev libncurses5-dev automake libtool bison libffi-dev
gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 
curl -sSL https://get.rvm.io | bash -s stable 
source ~/.rvm/scripts/rvm
rvm install 2.4.2 
rvm use 2.4.2 --default 
ruby -v

The installation step will change for different Ubuntu version

安装步骤会因 Ubuntu 版本不同而有所不同

For more info,

欲了解更多信息,

https://gorails.com/setup/ubuntu/14.04

https://gorails.com/setup/ubuntu/14.04

回答by Emjey

You can use sudo apt remove ruby

您可以使用 sudo apt remove ruby