在Ubuntu New更新之后,rvm的Ruby安装问题

时间:2014-02-28 16:48:55

标签: ruby-on-rails ruby ruby-on-rails-3 ubuntu

我正在安装rails。我正在使用Ubuntu 12.04 LLTS

  

vipin @ vipin-Satellite-C640:〜$ uname -a
  Linux 3.11.0-18-generic#32~minision1-Ubuntu SMP Thu Feb 20 17:54:21 UTC 2014 i686 i686 i386 GNU / Linux

首先我跟着this

但是当我尝试

  

rails -v

The program 'ruby' can be found in the following packages:
 * ruby1.8
 * ruby1.9.1
Try: sudo apt-get install <selected package>  

我通过

重新安装ruby
  

vipin @ vipin-Satellite-C640:〜$ rvm重新安装2.1.0

现在我试过

  

ruby​​ -v

同样的结果

vipin@vipin-Satellite-C640:~$ ruby -v
The program 'ruby' can be found in the following packages:
 * ruby1.8
 * ruby1.9.1
Try: sudo apt-get install <selected package>

我试图卸载rvm

vipin@vipin-Satellite-C640:~$ sudo apt-get --purge remove ruby-rvm
[sudo] password for vipin: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package ruby-rvm is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

更新: 我能够在Ubuntu中成功创建带有rails的应用程序。现在我更新并升级了内核。

1 个答案:

答案 0 :(得分:1)

你破坏了RVM的版本。 Ubuntu对RVM做了一些产生大量错误的东西,现在唯一安全的修复方法是:

sudo apt-get --purge remove ruby-rvm
sudo rm -rf /usr/share/ruby-rvm /etc/rvmrc /etc/profile.d/rvm.sh

打开新终端并验证旧RVM设置的环境是否干净(应该没有输出):

env | grep rvm

如果有输出,请尝试打开新终端,如果没有帮助,请重新启动计算机。

install RVM

\curl -L https://get.rvm.io | 
  bash -s stable --ruby --autolibs=enable --auto-dotfiles

如果您发现需要一些手握,请查看Installing Ruby on Ubuntu 12.04,这会给出更多解释。

相关问题