简体   繁体   English

尝试在Ubuntu上卸载并全新安装Ruby:是否仍安装Ruby?

[英]Trying to uninstall and fresh install Ruby on Ubuntu: do I still have Ruby installed?

I'm coming from Windows to Linux (Ubuntu) so I'm new to the CLI. 我从Windows迁移到Linux(Ubuntu),所以对CLI还是陌生的。 I had issues trying to install Rails so I figured a fresh install would help. 我在尝试安装Rails时遇到问题,因此我认为全新安装会有所帮助。 I'm following " Installing Ruby the Correct Way ." 我遵循的是“ 以正确的方式安装Ruby”

I thought I had uninstalled Ruby, but after installing 2.1.4 it still shows some Ruby folders. 我以为我已经卸载了Ruby,但是在安装2.1.4之后,它仍然显示一些Ruby文件夹。 Have I completely uninstalled Ruby? 我已经完全卸载了Ruby吗?

Downloading ruby-2.1.4.tar.gz...
-> http://dqw8nmjcqpjn7.cloudfront.net/bf9952cdeb3a0c6a5a27745c9b4c0e5e264e92b669b2b08efb363f5156549204
Installing ruby-2.1.4...
Installed ruby-2.1.4 to /home/richard/.rbenv/versions/2.1.4
richard@richard-ThinkPad-T400:~$ rbenv global 2.1.4
richard@richard-ThinkPad-T400:~$ ruby -v
The program 'ruby' can be found in the following packages:
* ruby
* ruby1.8
Try: sudo apt-get install <selected package>
richard@richard-ThinkPad-T400:~$ sudo rbenv global 2.1.4
richard@richard-ThinkPad-T400:~$ ruby -v
The program 'ruby' can be found in the following packages:
* ruby
* ruby1.8
Try: sudo apt-get install <selected package>

Are the "the following packages" on my local system? 我的本地系统上是否有“以下软件包”? or are they online? 还是他们在线?

EDIT I've been getting this error when I try to install RVM (and some other applications): 编辑当我尝试安装RVM(和一些其他应用程序)时,我一直收到此错误:

GPG signature verification failed for '/home/richard/.rvm/archives/rvm-1.26.0.tgz' - ' https://github.com/wayneeseguin/rvm/releases/download/1.26.0/1.26.0.tar.gz.asc '! try downloading the signatures:

 gpg --keyserver hkp://keys.gnupg.net --recv-keys D39DC0E3 they can be compared with: https://rvm.io/mpapis.asc https://keybase.io/mpapis 

gpg --keyserver hkp://keys.gnupg.net --recv-keys D39DC0E3 they can be compared with: https://rvm.io/mpapis.asc https://keybase.io/mpapis

 gpg --keyserver hkp://keys.gnupg.net --recv-keys D39DC0E3 they can be compared with: https://rvm.io/mpapis.asc https://keybase.io/mpapis 

Does this have anything to do with it? 这有关系吗? I wouldn't really think so but I'm a noob. 我真的不这么认为,但我是菜鸟。

Don't sudo rbenv anything or you will summon Cthulhu. 不要sudo rbenv任何东西都进行sudo rbenv否则您将召唤克苏鲁。 Use rbenv by itself. rbenv使用rbenv

Also, don't randomly follow guides on the internet until you're more familiar with your OS; 另外,在您更加熟悉操作系统之前,请不要随意遵循互联网上的指南。 They go stale, or start out wrong, or don't accurately apply to what you're doing. 它们变得过时,或者开始出错,或者没有正确地应用于您正在做的事情。 Instead, go to the source and follow the directions there. 相反,转到并按照那里的说明进行操作。

To find out what is installed on your machine, use locate to quickly find Ruby instances. 要查找您的计算机上安装了什么,请使用locate快速查找Ruby实例。 Something like: 就像是:

locate /bin/ruby | grep -v .rbenv

should narrow down whether multiple Rubies are installed outside the ~/.rbenv directory. 应该缩小在〜/ .rbenv目录之外是否安装了多个Ruby。

Traditionally, you'll find a normally installed system-wide Ruby in /usr/bin/ruby. 传统上,您会在/ usr / bin / ruby​​中找到正常安装的系统范围的Ruby。 A user installed one from source will probably be in /usr/local/bin/ruby unless you specifically said otherwise, probably with a PREFIX= directive. 除非您另外特别说明,否则从源安装源的用户可能会在/ usr / local / bin / ruby​​中,除非使用PREFIX=指令。

rbenv will default to installing Ruby in the ~/.rbenv hierarchy since it acts like a sandbox manager and will put all Rubies it installs underneath that directory. rbenv将默认在〜/ .rbenv层次结构中安装Ruby,因为它的作用类似于沙箱管理器,并将所有安装的Rubies都放置在该目录下。 RVM , a similar application, will use ~/.rvm, and in both cases, the purpose is to keep them where the user's permissions are sufficient to install and update gems without requiring the use of sudo . RVM是一个类似的应用程序,将使用〜/ .rvm,在这两种情况下,其目的都是将它们保留在用户权限足以安装和更新gem的位置,而无需使用sudo For general use, avoid sudo unless you understand what you're about to do, as it can turn a computer into an under-desk heater in seconds. 对于一般用途,除非您了解要做什么,否则请避免使用sudo ,因为sudo可以在几秒钟内将计算机变成台式加热器。


The shell uses the PATH variable to figure out where to look for executable commands. Shell使用PATH变量来找出在哪里查找可执行命令。 It sounds like your PATH isn't set correctly. 听起来您的PATH设置不正确。 If you followed the directions on the rbenv site, they say how to enable rbenv by modifying your ~/.bash_profile script. 如果您按照rbenv网站上的指示进行操作,他们会说如何通过修改〜/ .bash_profile脚本来启用rbenv。 Doing that, then closing and reopening your shell should bring rbenv to life. 这样做,然后关闭并重新打开您的外壳程序应该使rbenv栩栩如生。

Following that blog post, you are installing Ruby using a tool called rbenv, and if you only uninstalled one Ruby, that doesn't mean that all Rubies are uninstalled. 在该博客文章之后,您正在使用名为rbenv的工具安装Ruby,如果您仅卸载了一个Ruby,则并不意味着所有的Rubies都被卸载了。

The message that you posted shows that it is a local install: Installed ruby-2.1.4 to /home/richard/.rbenv/versions/2.1.4 which is a copy of the 4th line of your message. 您发布的消息表明它是本地安装:将Installed ruby-2.1.4 to /home/richard/.rbenv/versions/2.1.4 ,这是消息第四行的副本。

You can find out from whence your Ruby executable is being invoked by issuing at the command line: 您可以通过在命令行中执行以下命令来查找从何处调用您的Ruby可执行文件:

which ruby

You will then know if the program is available and which it is. 然后,您将知道该程序是否可用以及哪个可用。 Using ruby -v if it is there will tell you the version. 如果使用ruby -v ,它将告诉您版本。

You have done some of these steps and are finding out that your system does not know how to get to the Ruby, if it is indeed installed. 您已经完成了一些步骤,并且发现您的系统不知道如何安装Ruby(如果确实已安装)。

Right now, it is effectively uninstalled, as it is unavailable to your environment. 目前,由于您的环境不可用,因此已被有效卸载。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何卸载ruby-install安装的ruby - How to uninstall ruby installed by ruby-install 在尝试在ubuntu上安装rvm和ruby时,curl无法识别但已安装 - While trying to install rvm and ruby on ubuntu, curl is not recognized but is installed 我必须从源代码安装Ruby才能在Windows计算机上安装Ruby 2.2.0和Rails 4.2.0吗? - Do I have to install Ruby from source to get Ruby 2.2.0 and Rails 4.2.0 installed on my windows machine? 如何卸载Ruby on Rails并进行全新安装? - How do I uninstall Ruby on Rails and do a clean install? 试图在Ubuntu的rails 4上安装ruby和ruby吗? - Trying to install ruby and ruby on rails 4 on Ubuntu? 如何卸载/删除旧的ruby版本并保持更新。 我安装了两个版本的ruby - How to uninstall/delete older ruby version and keep newer. I have two version of ruby installed 如何在 ubuntu 上卸载 Ruby? - How can I uninstall Ruby on ubuntu? 在安装ruby1.9.2后,为什么我的ruby版本仍然是ubuntu上的旧版本? - why my ruby version is still an old version on ubuntu after I installed ruby1.9.2? 为什么尝试在 Ubuntu 20.04 WSL2 中安装 ruby 3.1.2 时不断出现 BUILD FAILURE? - Why do I keep getting BUILD FAILURE when trying to install ruby 3.1.2 in Ubuntu 20.04 WSL2? 如何在新的Mountain Lion安装上安装libv8 ruby​​ gem? - How do I install the libv8 ruby gem on a fresh Mountain Lion install?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM