0

My goal is: Install jruby-1.7.2 on my ubuntu system.

For that i have use:

manan@manan-laptop:~$ rvm install jruby-1.7.2

which successfully executes.

But when i have tried to check version(-v) ... i got

manan@manan-laptop:~$ jruby -v
jruby 1.5.6 (ruby 1.8.7 patchlevel 249) (2011-10-27 6586) (Java HotSpot(TM) Client VM 1.7.0_10) [i386-java]

version number 1.5.6 (instead of 1.7.2)

For cross verification, i tried to install jruby, and i found this:

manan@manan-laptop:~$ rvm install jruby-1.7.2
Already installed jruby-1.7.2.
To reinstall use:

    rvm reinstall jruby-1.7.2

so, i have agian tried and tried to reinstall...and got this:

manan@manan-laptop:~$ rvm reinstall jruby-1.7.2
/home/manan/.rvm/src/jruby-1.7.2 has already been removed.
Removing /home/manan/.rvm/rubies/jruby-1.7.2...
Searching for binary rubies, this might take some time.
Installing requirements for ubuntu, might require sudo password.
jruby-1.7.2 - #configure
jruby-1.7.2 - #download
jruby-1.7.2 - #validate archive
jruby-1.7.2 - #extract
jruby-1.7.2 - #validate binary
jruby-1.7.2 - #setup
Saving wrappers to '/home/manan/.rvm/wrappers/jruby-1.7.2'................................
jruby-1.7.2 - #importing default gemsets, this may take time.....................
Making gemset jruby-1.7.2 pristine....
Making gemset jruby-1.7.2@global pristine....

But again same...no change....

manan@manan-laptop:~$ jruby -v
jruby 1.5.6 (ruby 1.8.7 patchlevel 249) (2011-10-27 6586) (Java HotSpot(TM) Client VM 1.7.0_10) [i386-java]

How can i update jruby version? is this problem is realted to gems? rubygems?

possible duplicates: How to upgrade to a newer version of jruby

How do you update JRuby's gem command?

I have also tried:

root@manan-laptop:/home/manan# gem install rubygems-update
Fetching: rubygems-update-2.0.3.gem (100%)
Successfully installed rubygems-update-2.0.3
1 gem installed
Installing ri documentation for rubygems-update-2.0.3...
Installing RDoc documentation for rubygems-update-2.0.3...

But after this...i got...

root@manan-laptop:/home/manan# jruby -v
jruby 1.5.6 (ruby 1.8.7 patchlevel 249) (2011-10-27 6586) (Java HotSpot(TM) Client VM 1.5.0_19) [i386-java]
Error: Some library (perhaps JRuby) was built with a later JVM version.
Please use libraries built with the version you intend to use or an earlier one.
Exception trace follows:
java.lang.UnsupportedClassVersionError: Bad version number in .class file
    at org.jruby.Ruby.<init>(Ruby.java:3935)
    at org.jruby.Ruby.newInstance(Ruby.java:178)
    at org.jruby.Main.run(Main.java:217)
    at org.jruby.Main.run(Main.java:128)
    at org.jruby.Main.main(Main.java:97)

I am really confused....

Community
  • 1
  • 1
Manan Shah
  • 1,042
  • 2
  • 14
  • 26

1 Answers1

2

Issue the command:

$ rvm use jruby-1.7.2

and you should be switched to a jruby 1.7.2 environment.

It might be worth reading up on how to use rvm.

mcfinnigan
  • 11,442
  • 35
  • 28
  • thanks!! But it was my mistake to do last step. Now, what to do? Now when i did as u mention.... i got.."RVM is not a function, selecting rubies with 'rvm use ...' will not work. You need to change your terminal emulator preferences to allow login shell. Sometimes it is required to use `/bin/bash --login` as the command. Please visit https://rvm.io/integration/gnome-terminal/ for a example." – Manan Shah Jun 27 '13 at 13:10
  • ok...solved it. by the link: http://stackoverflow.com/questions/9336596/rvm-installation-not-working-rvm-is-not-a-function – Manan Shah Jun 27 '13 at 13:16