ada91 ada91 - 1 year ago 177
Ruby Question

How to enable C extension support in jRuby?

I want to install a gem but I get the following error:

Building native extensions. This could take a while...
ERROR: Error installing twitter-login:
ERROR: Failed to build gem native extension.

C:/nwcloud/jruby-1.7.2/bin/jruby.exe extconf.rb
NotImplementedError: C extension support is not enabled. Pass -Xcext.enabled=true to JRuby or set JRUBY_OPTS or modify .jrubyrc to enable.

I also read this question with the same problem, but I don't even know how to enable the support with the three options because I don't know how to pass
to JRuby or set JRUBY_OPTS or modify .jrubyrc to enable.

Can anybody help me with my beginner problem?

Answer Source

.jrubyrc edits suggested by Rodrigo didn't work for me (jdk 7u25 / JRuby 1.7.4), but exporting the JRUBY_OPTS did do the trick:

export JRUBY_OPTS="--1.9 -Xcext.enabled=true"
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download