7

Does anyone has the same error with jRuby? When I trying to install gem with C extension I have the next error:

gem install serialport Building native extensions. This could take a while... ERROR: Error installing serialport: ERROR: Failed to build gem native extension.

    /home/username/.rvm/rubies/jruby-head/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 /home/username/.rvm/rubies/jruby-head/lib/ruby/shared/mkmf.rb:8
require at org/jruby/RubyKernel.java:1021 (root) at /home/username/.rvm/rubies/jruby-head/lib/ruby/shared/rubygems/custom_require.rb:1 (root) at extconf.rb:1

Any arguments declared in errors explanation does not give any success...

Info about installed jruby version: jruby 1.7.0.preview2.dev (1.9.3p203) 2012-08-05 22cd6f9 on Java HotSpot(TM) Server VM 1.7.0_05-b05 [linux-i386]

Platform: Linux

Gem: serialport

Brian
  • 14,610
  • 7
  • 35
  • 43
Roman
  • 143
  • 1
  • 8

2 Answers2

1

As echristopherson as put it C extension support for JRuby is deprecated. In most gems you should find the Java specific version in RubyGems or a healthy alternative lyiing around in Github. I do not recommend you to try an hack the gem to work with jruby as it will be a world of pain...

mimsugara
  • 839
  • 11
  • 18
0

Have you tried the rs232 gem? It may have jruby support, as the ffi gem it depends on has jruby support. https://rubygems.org/gems/rs232

kristianp
  • 5,496
  • 37
  • 56