JRuby 9.1.12.0(2.3.3) Rubygem 2.6.11 赢7 Mongo 2.3.2 BSON-4.2.2
我已经转移到JRuby以使我能够使用一些基于Java的库,并且我已经设法安装了所有我原来的宝石黄瓜/ Rspec / Watir等,但我似乎无法安装Mongo Gem。我收到以下错误消息:
C:\Ruby\gem>jruby -S gem install mongo
Building native extensions. This could take a while...
C:/jruby-9.1.12.0/lib/ruby/stdlib/rubygems/ext/ext_conf_builder.rb:58: warning: Tempfile#unlink or delete called on open file
; ignoring
ERROR: Error installing mongo:
ERROR: Failed to build gem native extension.
current directory: C:/jruby-9.1.12.0/lib/ruby/gems/shared/gems/bson-4.2.2/ext/bson
C:/jruby-9.1.12.0/bin/jruby.exe -r ./siteconf20170719-4116-mhpj6s.rb extconf.rb
creating Makefile
current directory: C:/jruby-9.1.12.0/lib/ruby/gems/shared/gems/bson-4.2.2/ext/bson
make "DESTDIR=" clean
current directory: C:/jruby-9.1.12.0/lib/ruby/gems/shared/gems/bson-4.2.2/ext/bson
make "DESTDIR="
make: *** No rule to make target `C:/jruby-9.1.12.0/lib/ruby/include/ruby/ruby.h', needed by `bson_native.o'. Stop.
make failed, exit code 2
Gem files will remain installed in C:/jruby-9.1.12.0/lib/ruby/gems/shared/gems/bson-4.2.2 for inspection.
Results logged to C:/jruby-9.1.12.0/lib/ruby/gems/shared/extensions/universal-java-1.8/2.3.0/bson-4.2.2/gem_make.out
答案 0 :(得分:1)
这应该有用,也许干净bundle install
...以便您安装最新的宝石:
$ jruby -S gem install mongo
Fetching: bson-4.2.2-java.gem (100%)
Successfully installed bson-4.2.2-java
Fetching: mongo-2.4.2.gem (100%)
Successfully installed mongo-2.4.2
2 gems installed
$ jruby -v
jruby 9.1.8.0 (2.3.1) 2017-03-06 90fc7ab Java HotSpot(TM) 64-Bit Server VM 25.121-b13 on 1.8.0_121-b13 +jit [linux-x86_64]
答案 1 :(得分:0)
你正在尝试使用依赖于JRuby中原生扩展的MRI gem - 这不会起作用(很容易)。
您的选择是: