Joe
Joe

Reputation: 781

Windows (RVM) vs Linux (jruby): how to fix different gem requirements?

I suffer incompatible gem requirements when creating a Rails App on Windows (RVM) and deploying them to Linux (jRuby). How can I reconfigure the Rails requirements on the Linux/jRuby side, so I can bundle and run the app?

Since debug_inspector only exists on RVM, the gem requirements don't bundle on jRuby. Instead bundler complains:

Using debug_inspector 0.0.2

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

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

[...]/jruby-1.7.20/lib/ruby/shared/mkmf.rb:14: Use RbConfig instead of obsolete and deprecated Config. mkmf.rb can't find header files for ruby at [...]/jruby-1.7.20/lib/native/include/ruby/ruby.h

extconf failed, uncaught signal 1

Thanks

#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)

Upvotes: 0

Views: 298

Answers (1)

Andy Waite
Andy Waite

Reputation: 11076

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

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

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

Upvotes: 3

Related Questions