我正在尝试使用 Mina 在 JRuby 上部署一个应用程序,但是一个 gem 没有安装,实际上它不应该首先安装......
gem 是unf_ext
它是一个 Mechanize 依赖项。如果我通过 SSH 连接到服务器并尝试安装 Mechanize
,它安装没有问题,只有 unf
结果安装,而不是 unf_ext
.
错误:
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/home/linkrecover/.rbenv/versions/jruby-1.7.13/bin/jruby extconf.rb
NotImplementedError: C extension support is not enabled. Pass -Xcext.enabled=true to JRuby or set JRUBY_OPTS.
(root) at /home/linkrecover/.rbenv/versions/jruby-1.7.13/lib/ruby/shared/mkmf.rb:8
require at org/jruby/RubyKernel.java:1065
(root) at /home/linkrecover/.rbenv/versions/jruby-1.7.13/lib/ruby/shared/rubygems/core_ext/kernel_require.rb:1
(root) at extconf.rb:1
Gem files will remain installed in /var/www/lr/tmp/build-14062262733806/vendor/bundle/jruby/1.9/gems/unf_ext-0.0.6 for inspection.
Results logged to /var/www/lr/tmp/build-14062262733806/vendor/bundle/jruby/1.9/gems/unf_ext-0.0.6/ext/unf_ext/gem_make.out
An error occurred while installing unf_ext (0.0.6), and Bundler cannot continue.
Make sure that `gem install unf_ext -v '0.0.6'` succeeds before bundling.
我的 Gemfile:https://gist.github.com/davidhq/09d84bc79683b9d3332e
那么如何让 bundler 在通过 Mina 运行时很好地安装所有东西呢?
最佳答案
你声明的一些 gems(Gemfile.lock 应该告诉哪个)取决于 unf_ext
gem 使用原生 C 扩展。您需要以某种方式避免使用 JRuby(例如使用 平台::mri 就像您对其他人所做的那样)。详细信息取决于有问题的 gem 以及您需要多少 gem ,例如如果仅用于开发,只需将其移至 群:开发和 bundle --without development
关于ruby - 使用 Mina 安装 JRuby gem,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24941357/