无法使用rvm在ubuntu上安装jruby

发布于 2025-01-07 04:42:23 字数 2404 浏览 1 评论 0原文

我无法使用 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 上,我得到了同样的错误。

PS
我可以安装jruby-head而没有任何错误,但不能安装任何其他jruby版本。

编辑2:
通过安装 jruby 必要的依赖项,我终于让它工作了。
请参阅下面我的回答。

I can't install jruby on ubuntu 11.10 using rvm.

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.

Other useful information:

jatin@silverSpoon:~$ which ant
/usr/bin/ant

The contents of the log file generated are:

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 installed on my machine are:

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: 

What is wrong here?

EDIT:
On trying the answer, I get this

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...

and on rvm install jruby, I get the same error.

P.S.
I am able to install jruby-head without any errors, but not any other jruby version.

EDIT 2:
I finally got it working, by installing the necessary dependencies for jruby.
See my answer below.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

橘香 2025-01-14 04:42:23

gzip: stdin: not in gzip format 似乎下载的文件无效。

我建议您删除并重新安装它:

rvm remove jruby
rvm cleanup all
rvm install jruby

rvm cleanup all 意味着清理下载和缓存的所有内容。

我不明白的一件事:当我尝试 rvm install jruby 时,jruby-1.6.6 已安装,但在您的情况下是 jruby-1.6.4。
也许是因为您没有最新版本的rvm。更新rvm并重试。

rvm 要求 查看您是否忘记安装某些内容。 jruby 1.6 需要 open-jre-6,而不是 sun-jdk。希望这有帮助。

最终编辑:rvm 注释rvm 要求 并查看您是否遗漏了某些内容。如果您仍然无法安装jruby,我没有更多的想法(不过您可以尝试重新安装rvm)。

gzip: stdin: not in gzip format seems that the file downloaded is invalid.

I suggest that you remove and reinstall it:

rvm remove jruby
rvm cleanup all
rvm install jruby

rvm cleanup all means clean everything downloaded and cached.

One thing I don't understand: when I try rvm install jruby, jruby-1.6.6 got installed, but it's jruby-1.6.4 in your case.
maybe it is because you don't have the newest version of rvm. Update rvm and try again.

rvm requirements to see if you forget to install something. jruby 1.6 requires open-jre-6, not sun-jdk. hope this helps.

final edit: rvm notes, rvm requirements and see if you have missed something. I have no more ideas if you still can't install jruby(you could try reinstalling rvm though).

夏夜暖风 2025-01-14 04:42:23

通过安装 jruby 必要的依赖项,我终于让它工作了。
在运行rvm requests时,它会显示jrubyjruby-head的要求。

# For JRuby, install the following:
  jruby: /usr/bin/apt-get install curl g++ openjdk-6-jre-headless
  jruby-head: /usr/bin/apt-get install ant openjdk-6-jdk

我缺少curl,并且我使用的是sun-java而不是openjdk
在设置适当的 java 并安装curl后,我可以毫不费力地安装jruby

这也说明了为什么我可以安装jruby-head但不能安装jruby。感谢@Tyler Long 的所有帮助。

I finally got it working, by installing the necessary dependencies for jruby.
On running rvm requirements, it shows the requirements for jruby and jruby-head.

# For JRuby, install the following:
  jruby: /usr/bin/apt-get install curl g++ openjdk-6-jre-headless
  jruby-head: /usr/bin/apt-get install ant openjdk-6-jdk

I was missing curl, and I was using sun-java and not openjdk.
On setting the appropriate java and installing curl, I could install jruby without any hassle.

This also shows why I could install jruby-head but not jruby. Thanks @Tyler Long for all the help.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文