2012-02-24 247 views
8

我想在我的Linux Mint的12RVM安装:红宝石安装错误

安装Ruby我下面this tutorialthis one

当我运行rvm install 1.9.3我看到这个错误:

Installing Ruby from source to: /usr/share/ruby-rvm/rubies/ruby-1.9.3, this may take a while depending on your cpu(s)... 

ruby-1.9.3 - #fetching 
ruby-1.9.3 - #extracting ruby-1.9.3- to /usr/share/ruby-rvm/src/ruby-1.9.3 
ERROR: Error running 'bunzip2 < '/usr/share/ruby-rvm/archives/ruby-1.9.3-.tar.bz2' | tar xf - -C /usr/share/ruby-rvm/tmp/rvm_src_4428', please read /usr/share/ruby-rvm/log/ruby-1.9.3/extract.log 
ERROR: There has been an error while trying to extract the source. 
Halting the installation. 
ERROR: There has been an error fetching the ruby interpreter. Halting the installation. 

如何解决呢?

编辑:@ ka8725

bunzip2安装。当我运行cat /usr/share/ruby-rvm/log/ruby-1.9.3/extract.log

我看到

[2012-02-25 01:11:55] bunzip2 < '/usr/share/ruby-rvm/archives/ruby-1.9.3-.tar.bz2' | tar xf - -C /usr/share/ruby-rvm/tmp/rvm_src_32604 
bunzip2: (stdin) is not a bzip2 file. 
tar: This does not look like a tar archive 
tar: Exiting with failure status due to previous errors 
[2012-02-25 01:12:16] bunzip2 < '/usr/share/ruby-rvm/archives/ruby-1.9.3-.tar.bz2' | tar xf - -C /usr/share/ruby-rvm/tmp/rvm_src_32740 
bunzip2: (stdin) is not a bzip2 file. 
tar: This does not look like a tar archive 
tar: Exiting with failure status due to previous errors 
[2012-02-25 01:13:50] bunzip2 < '/usr/share/ruby-rvm/archives/ruby-1.9.3-.tar.bz2' | tar xf - -C /usr/share/ruby-rvm/tmp/rvm_src_383 
bunzip2: (stdin) is not a bzip2 file. 
tar: This does not look like a tar archive 
tar: Exiting with failure status due to previous errors 
[2012-02-25 01:13:52] bunzip2 < '/usr/share/ruby-rvm/archives/ruby-1.9.3-.tar.bz2' | tar xf - -C /usr/share/ruby-rvm/tmp/rvm_src_474 
bunzip2: (stdin) is not a bzip2 file. 
tar: This does not look like a tar archive 
tar: Exiting with failure status due to previous errors 
[2012-02-25 01:13:58] bunzip2 < '/usr/share/ruby-rvm/archives/ruby-1.9.3-.tar.bz2' | tar xf - -C /usr/share/ruby-rvm/tmp/rvm_src_568 
bunzip2: (stdin) is not a bzip2 file. 
tar: This does not look like a tar archive 
tar: Exiting with failure status due to previous errors 
[2012-02-25 01:18:57] bunzip2 < '/usr/share/ruby-rvm/archives/ruby-1.9.3-.tar.bz2' | tar xf - -C /usr/share/ruby-rvm/tmp/rvm_src_4428 
bunzip2: (stdin) is not a bzip2 file. 
tar: This does not look like a tar archive 
tar: Exiting with failure status due to previous errors 

ANOTHER编辑@EVERYONE :)

这里发生了什么人:

rvm requirements输出unrecognized error etc。但是rvm notes会显示我需要安装的东西。 但是当我安装这些东西,rvm将被删除 ,所以我必须重新安装大声笑! :)一次,两次,十次,永远:)会发生这种情况

这是什么意思,我需要

sudo apt-get install build-essential bison openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev 
+1

我们是在谈论一个新的'RVM '安装? – 2012-02-24 23:36:39

+0

@ s.m。是的,我没有rvm之前 – Lynob 2012-02-24 23:40:03

+0

你是否试图以root身份进行安装?另外,尝试运行'rvm requirements'来确保你拥有所有的依赖关系。 – 2012-02-24 23:46:04

回答

14

卸载并重新rvm

bash -s stable < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer) 

对于后人,我会补充说,说

Installing Ruby from source to: /usr/share/... 

错误的部分是什么让我想起了一个破碎的安装RVM的正如我所说,这通常完全包含在~/.rvm目录中。

0

cat /usr/share/ruby-rvm/log/ruby-1.9.3/extract.log

在我看来,你没有安装bunzip2包。你应该安装它

+0

请阅读我的编辑 – Lynob 2012-02-24 23:48:36

1

你试过这个答案Installed Ruby 1.9.3 with RVM but command line doesn't show ruby -v

它接缝你使用“apt-get broken rvm”确保你按照上面的答案。解决

+0

请阅读我的编辑 – Lynob 2012-02-25 00:07:10

+0

/usr/share/ruby​​-rvm - 这是RVM的非标准安装路径,它是由Ubuntu创建的,并且此路径中的内容已损坏,不仅存在问题 - 而且更多,这就是为什么我建议清理它,并开始新鲜 – mpapis 2012-02-25 23:02:02

+0

我跟着你的回答,所以我应该清除我的环境,仍然不得不使用'usr/share/ruby​​-rvm',所以如果我说你有其他问题,那么我的问题是不是真的解决了大声笑! – Lynob 2012-02-25 23:37:46

2

问题,这里就是你要如何的情况下,要知道:

由于S.M.说,我卸载了一切,然后我打开另一个终端会话作为一个普通用户,然后运行:

bash -s stable < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer) 

然后我运行source /home/my-desktop-username/.rvm/scripts/rvm作为普通用户不是root

然后我运行rvm requirements为普通用户。然后我复制的要求和关闭会话,打开一个会话,并使用sudo

然后我关闭会话和开放普通用户会话并运行rvm install ruby-1.9.3-p125如果您运行此命令安装要求根,它会说rvm没有安装,并会建议您使用sudo apt-get install rvm安装它不要这样做!

所以基本上我有两个问题,那我也跟着不说,我应该运行

source /home/my-desktop-username/.rvm/scripts/rvm,并没有说我不应该运行rvmSM告诉教程我那个。感谢大家,特别是s.m

不要相信博主,Youtube用户或论坛。只有信任STACKOVERFLOW用户!

1

我有与bunzip2相同的问题。

在〜/ .rvm /日志/红宝石1.9.3-P125/extract.log尾说:

bunzip2: (stdin) is not a bzip2 file. 
tar: This does not look like a tar archive 
tar: Exiting with failure status due to previous errors 

原来下载的文件是RVM网站的HTML网页,而不是档案本身。

所以,如果像我一样以前的解决方案没有解决。检查你的存档文件类型:

$ file ruby-1.9.3-p125.tar.bz2 
ruby-1.9.3-p125.tar.bz2: HTML document, UTF-8 Unicode text, with very long lines 

如果你得到这样的事情,只是删除档案,并尝试重新安装。

6

我解决我的问题简单地做:

rvm get head rvm reloadrvm install 1.9.3

5

做一个RVM更新作为一个评论建议告诉我如何来解决这个问题的一些好的错误。我按照错误中的建议清除了apt-get ruby​​-rvm,并使用curl进行安装。像魅力一样工作。查看文件名rvm的apt-get版本正在抓取它,看起来由于某种原因,该版本的最后一部分缺失。它应该是ruby-1.9.3-p327.tar.bz2或者其他类似的文件,而不是ruby-1.9.3-.tar.bz2。

这里是我做的,哪些是由错误的RVM更新后建议:

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

    open new terminal and validate environment is clean from old rvm settings: 

    env | GREP_OPTIONS= \grep rvm 

install RVM: 

    curl -L https://get.rvm.io | bash -s stable 

fix some more screwed up stuff from apt-get ruby-gem 

    make ~/.bash_profile look like this(it loads rvm as a function in bash): 

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

update RVM: 

    rvm update 
    rvm reload 

install ruby 

    rvm install 1.9.3 
    rvm use 1.9.3 --default 

install current rubygems 

    rvm rubygems current 

install rails 

    gem install rails 

完成!

1

如果cat /usr/share/ruby-rvm/archives/ruby-1.9.3-.tar.bz2你会看到

<html> <head><title>404 Not Found</title></head> <body bgcolor="white"> <center><h1>404 Not Found</h1></center> <hr><center>nginx/1.2.1</center> </body>

因此,RVM不知道在哪里可以找到红宝石1.9.3(似乎路径是围绕错位 '3-的.tar')

而且,1.9.1与1.9.3的“兼容性”在Ubuntu中是一个(不太有趣)的笑话。

对我来说,修复是:

rvm package install openssl

rvm install ruby-1.9.2 --with-openssl-dir=/usr/share/ruby-rvm/usr

随着1.9.2正巧符合我所有的gem依赖的(如引入nokogiri)