开发者

How to force Jruby to use inbuilt Ruby 1.9 instead of Ruby 1.8 which is default?

I have developed a Ruby on Rails application and successfully deployed on Weblogic using Jruby and Warbler (which creates a war file based on the sett开发者_JS百科ings in config/warble.rb).

I believe although Jruby comes with inbuilt Ruby 1.8 and 1.9, by default it uses 1.8 and I want to test the same rails application in Ruby 1.9 within JRuby as I heard that Ruby 1.9 is a lot faster than 1.8. I do not see any configuration option in warble.rb

where we can specify to use Ruby version to use. Whats the best way to force Jruby to use Ruby 1.9?

Also my Rails application is based on Rails 2.3.2, are there any compatability issues on running rails application (built on 2.3.2) on Ruby 1.9? If so will upgrading rails to 2.3.5 solve the problem?

Thanks in advance.


you specify it as an argument on the command line

 jruby --1.9 -v

Don't know about the compatibility issues.


I follow configuration guide of JRuby https://github.com/jruby/jruby/wiki/ConfiguringJRuby and it work.

  • Create .jrubyrc in user directory (C:\Users\tvo1510 on Window 7) with content: compat.version=1.9

It's done. Cheers,


in config/warble.rb, look for this line:

# config.webxml.jruby.compat.version = "1.9" 

uncomment it and re-run warble.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜