我无法使用 rvm 在 ubuntu 11.10 上安装 jruby。
jatin@silverSpoon:~$ rvm install jruby
jruby-1.6.4 - #fetching
jruby-1.6.4 - #extracting jruby-bin-1.6.4 to /home/jatin/.rvm/src/jruby-1.6.4
ERROR: Error running 'tar xzf "/home/jatin/.rvm/archives/jruby-bin-1.6.4.tar.gz" -C /home/jatin/.rvm/tmp/rvm_src_4913 --no-same-owner', please read /home/jatin/.rvm/log/jruby-1.6.4/extract.log
ERROR: There has been an error while trying to extract the source.
Halting the installation.
ERROR: There has been an error while trying to fetch the source.
Halting the installation.
其他有用信息:
jatin@silverSpoon:~$ which ant
/usr/bin/ant
生成的日志文件内容为:
jatin@silverSpoon:~$ cat ~/.rvm/log/jruby-1.6.4/extract.log
[2012-02-22 00:47:37] tar xzf "/home/jatin/.rvm/archives/jruby-bin-1.6.4.tar.gz" -C /home/jatin/.rvm/tmp/rvm_src_4913 --no-same-owner
gzip: stdin: not in gzip format
tar: Child returned status 1
tar: Error is not recoverable: exiting now
我的机器上安装的 Java 是:
jatin@silverSpoon:~$ update-alternatives --config java
There are 3 choices for the alternative java (providing /usr/bin/java).
Selection Path Priority Status
------------------------------------------------------------
0 /usr/lib/jvm/java-6-openjdk/jre/bin/java 1061 auto mode
1 /usr/lib/jvm/java-6-openjdk/jre/bin/java 1061 manual mode
2 /usr/lib/jvm/java-7-openjdk-i386/jre/bin/java 1051 manual mode
* 3 /usr/lib/jvm/jdk1.7.0/jre/bin/java 3 manual mode
Press enter to keep the current choice[*], or type selection number:
这里有什么问题?
编辑:
在尝试答案时,我明白了
jatin@silverSpoon:~/android/eclipse$ rvm remove jruby
it seems that /home/jatin/.rvm/src/jruby-1.6.4 is already non existent.
it seems that /home/jatin/.rvm/rubies/jruby-1.6.4 is already non existent.
Removing jruby-1.6.4 aliases...
Removing jruby-1.6.4 wrappers...
Removing jruby-1.6.4 environments...
Removing jruby-1.6.4 binaries...
然后rvm install jruby
,我得到同样的错误。
附言。
我能够安装jruby-head
没有任何错误,但不能安装任何其他 jruby 版本。
编辑 2:
通过安装 jruby 的必要依赖项,我终于让它工作了。
请看下面我的回答。