JRuby 1.6.0RC1 - Rails 3 in 1.9 mode

Hello,

I’m trying to do this:

jruby --1.9 --server -S bundle exec rails s

It always runs as 1.8.7 instead of 1.9.2

If I do:

jruby --1.9 --server -S rails s

it fails with

org/jruby/RubyModule.java:2528:in const_missing': uninitialized constant Bundler (NameError) from /Users/robertrouse/work/project/config/boot.rb:7:in(root)’
from org/jruby/RubyKernel.java:1047:in require19' from script/rails:5:in(root)’

Any idea what I’m doing wrong here?

Thanks!

Do you know if the gems installed were installed for 1.8 or 1.9 JRuby?

when I run

jruby --1.9 -S rails s

I get a gem not found error: `report_activate_error’: Could not find
RubyGem
rails (>= 0)

So, I installed the gems with 1.9:

jruby --1.9 -S gem install rails

and I was a happy camper.

Clarifying further:

PS C:\mydocs> jruby -S gem env
RubyGems Environment:

  • RUBYGEMS VERSION: 1.5.0
  • RUBY VERSION: 1.8.7 (2011-01-10 patchlevel 330) [java]
  • INSTALLATION DIRECTORY: C:/jruby-1.6.0.RC1/lib/ruby/gems/1.8
  • RUBY EXECUTABLE: C:/jruby-1.6.0.RC1/bin/jruby.exe
  • GEM PATHS:
    • C:/jruby-1.6.0.RC1/lib/ruby/gems/1.8
    • C:/mydocs/.gem/jruby/1.8

PS C:\mydocs> jruby --1.9 -S gem env
RubyGems Environment:

  • RUBYGEMS VERSION: 1.5.0
  • RUBY VERSION: 1.9.2 (2011-01-10 patchlevel 136) [java]
  • INSTALLATION DIRECTORY: C:/jruby-1.6.0.RC1/lib/ruby/gems/1.9
  • RUBY EXECUTABLE: C:/jruby-1.6.0.RC1/bin/jruby.exe
  • GEM PATHS:
    • C:/jruby-1.6.0.RC1/lib/ruby/gems/1.9
    • C:/mydocs/.gem/jruby/1.9

1.9 gems have a different location than 1.8 gems.

Actually,

I’m running this under RVM, so the gem path would be the same. When I do
jruby --1.9 -S gem list, I see all the gems I installed.

Unfortunately, RVM is outside of my knowledge. I’m stuck on WinXP for
the
time being, so RVM is not something I can leverage.

Ah, that makes sense. I would have run it in 1.8 mode.

Thanks.

Unfortunately, RVM is outside of my knowledge. I’m stuck on WinXP for the
time being, so RVM is not something I can leverage.

if you have (or want) multiple rubies installed on your WinXP, take a
look into https://github.com/vertiginous/pik/

C:\Users\Jon>pik ls
160: jruby 1.6.0.RC1 (ruby 1.8.7 patchlevel 330) (2011-01-10 769f847)
187: ruby 1.8.7 (2010-12-23 patchlevel 330) [i386-mingw32]

  • 192: ruby 1.9.2p174 (2011-01-28 revision 30696) [i386-mingw32]
    193: ruby 1.9.3dev (2011-02-04 trunk 30778) [i386-mingw32]

Jon


blog: http://jonforums.github.com/
twitter: @jonforums

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs