Question

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.

Was it helpful?

Solution

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

OTHER TIPS

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top