Stdlib in JRuby

Hi all,

I’ve got JRuby installed via RVM and am trying to use some of the
libraries
in stdlib (specifically Ripper), but it’s failing like so:

rvm use jruby-1.6.7
Using /Users/bploetz/.rvm/gems/jruby-1.6.7

export JRUBY_OPTS=–1.9

irb
jruby-1.6.7 :001 > RUBY_VERSION
=> “1.9.2”
jruby-1.6.7 :002 > require ‘ripper’
LoadError: no such file to load – ripper
from org/jruby/RubyKernel.java:1042:in require' from /Users/bploetz/.rvm/rubies/jruby-1.6.7/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in require’
from
/Users/bploetz/.rvm/rubies/jruby-1.6.7/lib/ruby/1.9/ripper/core.rb:11:in
(root)' from org/jruby/RubyKernel.java:1042:in require’
from
/Users/bploetz/.rvm/rubies/jruby-1.6.7/lib/ruby/1.9/ripper/core.rb:36:in
require' from /Users/bploetz/.rvm/rubies/jruby-1.6.7/lib/ruby/1.9/ripper.rb:1:in (root)’
from org/jruby/RubyKernel.java:1042:in require' from /Users/bploetz/.rvm/rubies/jruby-1.6.7/lib/ruby/1.9/ripper.rb:36:in require’
from (irb):2:in evaluate' from org/jruby/RubyKernel.java:1088:in eval’
from org/jruby/RubyKernel.java:1410:in loop' from org/jruby/RubyKernel.java:1197:in catch’
from org/jruby/RubyKernel.java:1197:in catch' from /Users/bploetz/.rvm/rubies/jruby-1.6.7/bin/irb:17:in (root)’

Note that there does appear to be ruby files for Ripper in the JRuby
install (/Users/bploetz/.rvm/rubies/jruby-1.6.7/lib/ruby/1.9/ripper.rb,
etc), but it’s failing on this line in ripper/core.rb:

require ‘ripper.so’

I searched and couldn’t find this shared object anywhere. So my question
is, should Ripper in fact work in JRuby and the fact that this .so
doesn’t
exist is a symptom of something going wrong when installing JRuby via
RVM
(or perhaps there’s somthing else I need to install)? Or is Ripper not
supported on JRuby? I checked
Ruby1_9Support · jruby/jruby Wiki · GitHub and didn’t see any
mention of Ripper.

Thanks.
BP

Ripper is an MRI syntax analyzer and it doesn’t work with JRuby.

Thanks Hirotsugu. Is there a JRuby-specific lexer/parser available that
I
could use instead? I stumbled upon this…

http://olabini.com/blog/2007/07/some-jruby-tricks/

…but I can’t seem to find official documentation for the JRuby
module/class and how it works.

BP