无法使用 JRuby 构建 gem 本机扩展

2023-12-13

我将 ruby​​ 版本从 ruby​​ 1.9.3-p125 更改为 JRuby 1.7.0-preview1红宝石构建。当我执行时jruby -S bundle install在我的项目中,有一些错误如下,

...
Using bson (1.6.2) 
Installing bson_ext (1.6.2) with native extensions
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

        /Users/joshchang/.rbenv/versions/jruby-1.7.0-preview1/bin/jruby extconf.rb 
NotImplementedError: C extension support is not enabled. Pass -Xcext.enabled=true to JRuby or set JRUBY_OPTS or modify .jrubyrc to enable.

   (root) at /Users/joshchang/.rbenv/versions/jruby-1.7.0-preview1/lib/ruby/shared/mkmf.rb:8
  require at org/jruby/RubyKernel.java:991
   (root) at /Users/joshchang/.rbenv/versions/jruby-1.7.0-preview1/lib/ruby/shared/rubygems/custom_require.rb:1
   (root) at extconf.rb:1
...

有什么建议吗?谢谢。


JRUBY_OPTS="-Xcext.enabled=true" gem install <your gem>应该管用!

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

无法使用 JRuby 构建 gem 本机扩展 的相关文章

随机推荐