简体   繁体   English

使用RVM安装Ruby

[英]Installing Ruby with RVM

I'm trying to install Ruby on Rails using RVM. 我正在尝试使用RVM安装Ruby on Rails。 I am following this guide 我正在遵循本指南

http://ryanbigg.com/2010/12/ubuntu-ruby-rvm-rails-and-you/ http://ryanbigg.com/2010/12/ubuntu-ruby-rvm-rails-and-you/

I have just installed RVM, and used rvm install 1.9.2, but when I try to run ruby -v, I get this error 我刚刚安装了RVM,并使用rvm install 1.9.2,但是当我尝试运行ruby -v时,出现此错误

The program 'ruby' is currently not installed.  You can install it by typing:
sudo apt-get install ruby

I am not sure whether or not to install ruby using apt-get. 我不确定是否使用apt-get安装ruby。 The tutorial mentions to avoid using apt-get when installing ruby and stuff. 本教程提到在安装ruby和东西时避免使用apt-get。 Also, I installed ruby on RVM. 另外,我在RVM上安装了ruby。 I am confused, any help will be appreciated. 我很困惑,任何帮助将不胜感激。 Thanks in advance! 提前致谢!

After you do rvm install 1.9.2 , you need to tell RVM to use that installed version of Ruby: 在完成rvm install 1.9.2 ,您需要告诉RVM使用该已安装的Ruby版本:

rvm use 1.9.2

To make this the default: 使其成为默认值:

rvm use 1.9.2 --default

You may need to do a source ~/.bashrc to update the changes, or even reboot/logout (Ubuntu sometimes doesn't fully reload everything until a complete reboot). 您可能需要执行source ~/.bashrc来更新更改,甚至重新启动/注销(Ubuntu有时直到完全重新启动后才会完全重新加载所有内容)。

尝试打开另一个终端或运行源.bash_profile

安装RVM时,您还记得将这一行添加到〜/ .bash_profile并重新加载shell吗?

[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM