使用jRuby捆绑安装错误

时间:2015-10-19 08:51:20

标签: ruby-on-rails ruby gem bundle 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.

任何人都可以解决这个问题。我在使用jRuby作为RVM时遇到此错误。感谢。

2 个答案:

答案 0 :(得分:3)

binding_of_caller不适用于JRuby。请参阅README

  

仅适用于MRI Ruby 1.9.2,1.9.3,2.0,2.1和RBX(Rubinius)

  

jruby 1.7.x有实验支持,但它仅适用于解释模式(即使用选项-Djruby.compile.mode=OFF或将compile.mode=OFF追加到.jrubyrc

答案 1 :(得分:0)

sudo gem install binding_of_caller -v'0.7.2'在终端并点击回车,如果它不工作则进入gemfile在记事本中打开并注释行(表示放#符号)binding_of_caller