Home Php C# Sql C C++ Javascript Python Java Go Android Git Linux Asp.net Django .net Node.js Ios Xcode Cocoa Iphone Mysql Tomcat Mongodb Bash Objective-c Scala Visual-studio Apache Elasticsearch Jar Eclipse Jquery Ruby-on-rails Ruby Rubygems Android-studio Spring Lua Sqlite Emacs Ubuntu Perl Docker Swift Amazon-web-services Svn Html Ajax Xml Java-ee Maven Intellij-idea Rvm Macos Unix Css Ipad Postgresql Css3 Json Windows-server Vue.js Typescript Oracle Hibernate Internet-explorer Github Tensorflow Laravel Symfony Redis Html5 Google-app-engine Nginx Firefox Sqlalchemy Lucene Erlang Flask Vim Solr Webview Facebook Zend-framework Virtualenv Nosql Ide Twitter Safari Flutter Bundle Phonegap Centos Sphinx Actionscript Tornado Register | Login | Edit Tags | New Questions | 繁体 | 简体

68
votes
answers
楼主
73 views
+10

如何從系統中刪除RVM(Ruby版本管理器)?

如何從系統中刪除RVM(Ruby版本管理器)?

不確定你是否打算刪除rvm - 它可能是它的“突兀性” - 但是rbenv是一個值得替代的選擇。你仍然可以在你的系統上管理多個Ruby版本,但它不會覆蓋shell命令,也不管理gemsets(Bundler綽綽有餘),不需要在shell中加載。 - Jochem Schulenklopper 12年10月20日19:36

沙发
+280

When using implode and you see:

Psychologist intervened, cancelling implosion, crisis avoided :)

Then you may want to use --force

rvm implode --force

Then remove rvm from following locations:

rm -rf /usr/local/rvm
sudo rm /etc/profile.d/rvm.sh
sudo rm /etc/rvmrc
sudo rm ~/.rvmrc

Check the following files and remove or comment out references to rvm

~/.bashrc 
~/.bash_profile 
~/.profile 
~/.zshrc
~/.zlogin

Comment-out / Remove the following lines from /etc/profile

 source /etc/profile.d/sm.sh
 source /etc/profile.d/rvm.sh

/etc/profile is a readonly file so use

sudo vim /etc/profile

And after making the change write using a bang!

:w!

Finally re-login / restart your terminal.

板凳
+170

In addition to @tadman's answer I removed the wrappers in /usr/local/bin as well as the file /etc/profile.d/rvm.

The wrappers include:

erb
gem
irb
rake
rdoc
ri
ruby
testrb
地板
+70

A lot of people do a common mistake of thinking that 'rvm implode' does it . You need to delete all traces of any .rm files . Also , it will take some manual deletions from root . Make sure , it gets deleted and also all the ruby versions u installed using it .

4楼
+60

Remove the RVM load script from /.bash_rc or /.zsh_rc, then use:

rm -rf /.rvm

Or:

rvm implode
5楼
+40

Run the following command

rvm implode

Now you need to unistall the rvm gem:

gem uninstall rvm

Check if there are any remaining rvm files in your home directory, if yes remove them.

Go to the home directory and list all hidden files

ls -a

rm  .rvm
rm  .rvmrc
6楼
+30

Note that if you installed RVM via apt-get, you have to run some further steps than rvm implode or apt-get remove ruby-rvm to get it to really uninstall.

See "Installing RVM on Ubuntu".

您可以使用與map方法類似的技巧:array.map(&:price).inject(:+) - markquezada 2011年9月8日在2:58

array.map(&:price).inject(0,:+)更安全一些。它確保如果你有一個空列表,你得到0而不是零。 - 約翰夫2011年10月4日9:21

使用array.map(...)。inject(...)是低效的,你將遍歷所有數據兩次。嘗試array.inject(0){| sum,product | sum + = product.price} - everett1992 2013年4月4日6:11

7楼
+20

If you're still getting a env: ruby_executable_hooks: No such file or directory when calling some Ruby package, that means RVM left a little gift for you in your $PATH.

Run the following to find the offending scripts:

grep '#!/usr/bin/env ruby_executable_hooks' /usr/local/bin/*

Then rm all the matches. You'll have to reinstall all of those libraries with an RVM-free gem, of course.

我同意,reduce告訴我更多關於函數的功能,但是注入確實聽起來更酷。 - everett1992 2013年4月4日6:13

同意最後的評論,你給了我最好的答案。 - Jerska 2013年11月11日19:13

我要做的一個評論是在MapReduce之前減少和映射為高階函數。靈感以另一種方式運行。而在MapReduce意義上,它與簡單的功能減少有些不同,對不同機器的通信方式有影響。 - acjay 2015年4月13日14:01

Ken Iverson在編程語言APL中引入了操作符/稱為“簡化運算符”。資料來源:艾弗森,肯尼思。1962年。一種編程語言。威利。另一個來源:“作為思想工具的符號”,1979年ACM圖靈獎演講,Kenneth E. Iverson,dl.acm.org / ft_gateway.cfm?id = 1283935&type = pdf - Fernando Pelliccioni 2016年7月25日1:50

8楼
+10

For other shell newbies trying to fix the PATH variable

After following instructions in accepted answer, check and modify your PATH variable if necessary :

env | grep PATH 

if you see "rvm" anywhere, you need to figure out where you are setting PATH and modify. I was setting it in 3 files - so check all the following files:

vim .bashrc  

Delete the lines in the file referencing rvm using the dd command. :wq to save and exit.
source .bashrc to "reload"

Repeat this process (starting with the vim command) for .profile and .bash_profile

較新版本的activesupport默認情況下不會實際加載所有擴展。您只需要求sum模塊:require'active_support / core_ext / enumerable.rb',或者需要所有主動支持:require'active_support / all'。更多相關信息:API Docs - Dylan Cashman 2012年3月21日20:42

不要緊,activesupport是拖延到項目中從array.inject(:+)到array.sum的大量依賴。 - meagar•2016年2月11日13:29

Nitpick給出了一個好的評論:它應該是'active_support / core_ext / enumerable'而沒有.rb後綴,因為這是隱式添加的。 - Per Lundberg 2016年7月6日14:34

discard