我的目标是:在我的ubuntu系统上安装jruby-1.7.2。
为此我使用了:
manan@manan-laptop:~$ rvm install jruby-1.7.2
成功执行。
但是当我试图检查版本(-v)时......我得到了
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]
版本号1.5.6(而不是1.7.2)
对于交叉验证,我试图安装jruby,我发现了这个:
manan@manan-laptop:~$ rvm install jruby-1.7.2
Already installed jruby-1.7.2.
To reinstall use:
rvm reinstall jruby-1.7.2
所以,我有agian试过并尝试重新安装......并得到了这个:
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....
但同样......没有变化......
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]
如何更新jruby版本? 这个问题是出于宝石吗?的rubygems?
可能重复: How to upgrade to a newer version of jruby
How do you update JRuby's gem command?
我也尝试过:
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...
但在此之后......我得到了......
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)
我真的很困惑....
答案 0 :(得分:2)
发出命令:
$ rvm use jruby-1.7.2
你应该切换到jruby 1.7.2环境。
可能值得一读如何使用rvm。