0

在 Windows (RVM) 上创建 Rails 应用程序并将它们部署到 Linux (jRuby) 时,我遇到了不兼容的 gem 要求。如何在 Linux/jRuby 端重新配置 Rails 要求,以便捆绑和运行应用程序?

由于debug_inspector仅存在于 RVM 上,因此 gem 要求不捆绑在 jRuby 上。相反,捆绑器抱怨:

使用 debug_inspector 0.0.2

Gem::Ext::BuildError: 错误: 无法构建 gem 原生扩展。

[...]/jruby-1.7.20/bin/jruby -r ./siteconf20150523-28378-1i9zw09.rb extconf.rb

[...]/jruby-1.7.20/lib/ruby/shared/mkmf.rb:14:使用 RbConfig 而不是过时和弃用的 Config。mkmf.rb 在 [...]/jruby-1.7.20/lib/native/include/ruby/ruby.h 找不到 ruby​​ 的头文件

extconf 失败,未捕获信号 1

谢谢

#diff Gemfile.lock_rvm Gemfile.lock_jruby
2c2
<   remote: http://rubygems.org/
---
>   remote: https://rubygems.org/
32a33,37
>     activerecord-jdbc-adapter (1.3.16)
>       activerecord (>= 2.2)
>     activerecord-jdbcsqlite3-adapter (1.3.16)
>       activerecord-jdbc-adapter (~> 1.3.16)
>       jdbc-sqlite3 (>= 3.7.2, < 3.9)
40,41d44
<     binding_of_caller (0.7.2)
<       debug_inspector (>= 0.0.1)
43,44d45
<     byebug (5.0.0)
<       columnize (= 0.9.0)
52,53d52
<     columnize (0.9.0)
<     debug_inspector (0.0.2)
59c58
<     jbuilder (2.2.16)
---
>     jbuilder (2.2.13)
61a61
>     jdbc-sqlite3 (3.8.7)
66c66
<     json (1.8.2)
---
>     json (1.8.2-java)
72d71
<     mini_portile (0.6.2)
75,76c74,76
<     nokogiri (1.6.6.2-x86-mingw32)
<       mini_portile (~> 0.6.0)
---
>     nokogiri (1.6.6.2-java)
>     puma (2.11.2-java)
>       rack (>= 1.1, < 2.0)
107c107
<     sass (3.4.14)
---
>     sass (3.4.13)
119c119
<     sprockets-rails (2.3.1)
---
>     sprockets-rails (2.3.0)
123c123,125
<     sqlite3 (1.3.10-x86-mingw32)
---
>     therubyrhino (2.0.4)
>       therubyrhino_jar (>= 1.7.3)
>     therubyrhino_jar (1.7.6)
125c127
<     thread_safe (0.3.5)
---
>     thread_safe (0.3.5-java)
136,140d137
<     web-console (2.1.2)
<       activemodel (>= 4.0)
<       binding_of_caller (>= 0.7.2)
<       railties (>= 4.0)
<       sprockets-rails (>= 2.0, < 4.0)
143c140
<   x86-mingw32
---
>   java
146c143
<   byebug
---
>   activerecord-jdbcsqlite3-adapter
149a147
>   puma
153c151
<   sqlite3
---
>   therubyrhino
157d154
<   web-console (~> 2.0)
4

1 回答 1

3

Use the platforms option in the Gemfile, e.g.

gem "ruby-debug", :platforms => :mri_18

http://bundler.io/v1.3/man/gemfile.5.html

于 2015-05-23T14:36:19.057 回答