我用 rbenv 安装了 JRuby
ruby -v
jruby 1.6.7.2 (ruby-1.9.2-p312) (2012-05-01 26e08ba) (Java HotSpot(TM) 64-Bit Server VM 1.7.0_01) [linux-amd64-java]
which ruby
~/.rbenv/shims/ruby
gem env
RubyGems Environment:
- RUBYGEMS VERSION: 1.8.24
- RUBY VERSION: 1.9.2 (2012-05-01 patchlevel 312) [java]
- INSTALLATION DIRECTORY: /home/myjava_api/.rbenv/versions/jruby-1.6.7.2/lib/ruby/gems/1.8
- RUBY EXECUTABLE: /home/myjava_api/.rbenv/versions/jruby-1.6.7.2/bin/jruby
- EXECUTABLE DIRECTORY: /home/myjava_api/.rbenv/versions/jruby-1.6.7.2/bin
- RUBYGEMS PLATFORMS:
- ruby
- universal-java-1.7
- GEM PATHS:
- /home/myjava_api/.rbenv/versions/jruby-1.6.7.2/lib/ruby/gems/1.8
- /home/myjava_api/.gem/jruby/1.9
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- "install" => "--no-rdoc --no-ri"
- "update" => "--no-rdoc --no-ri"
- REMOTE SOURCES:
- http://rubygems.org/
但是 $JRUBY_HOME 没有设置
当我将 $JRUBY_HOME 设置为“/home/myjava_api/.rbenv/versions/jruby-1.6.7.2/bin/jruby”并在重新登录后执行“ ruby -v ”时出现错误:“错误:找不到或加载主类 org.jruby.Main "
当我删除 $JRUBY_HOME 变量“ ruby -v ”工作正常
什么必须是正确的 $JRUBY_HOME 值?