Search code examples
ruby-on-railsrubyrubygemsbundlejruby

bundle install error with jRuby


Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

/home/nikhil/.rvm/rubies/jruby-1.7.19/bin/jruby -r ./siteconf20151019-18379-17l4c3t.rb extconf.rb
/home/nikhil/.rvm/rubies/jruby-1.7.19/lib/ruby/shared/mkmf.rb:14: Use RbConfig instead of obsolete and deprecated Config.
mkmf.rb can't find header files for ruby at /home/nikhil/.rvm/rubies/jruby-1.7.19/lib/native/include/ruby/ruby.h

extconf failed, uncaught signal 1

Gem files will remain installed in /home/nikhil/.rvm/gems/jruby-1.7.19@mbiprint/gems/binding_of_caller-0.7.2 for inspection.
Results logged to /home/nikhil/.rvm/gems/jruby-1.7.19@mbiprint/extensions/universal-java-1.6/1.9/binding_of_caller-0.7.2/gem_make.out
An error occurred while installing binding_of_caller (0.7.2), and Bundler cannot
continue.
Make sure that `gem install binding_of_caller -v '0.7.2'` succeeds before
bundling.

Can anyone please solve this. I am getting this error while using jRuby as RVM. Thanks.


Solution

  • binding_of_caller does not work with JRuby. See the README:

    Only works in MRI Ruby 1.9.2, 1.9.3, 2.0, 2.1 and RBX (Rubinius)

    and

    There is experimental support for jruby 1.7.x, but it only works in interpreted mode (i.e. use the option -Djruby.compile.mode=OFF or append compile.mode=OFF to your .jrubyrc)