Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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 -Xcext.enabled=true to JRuby or set JRUBY_OPTS or modify .jrubyrc to enable.

Can anybody help me with my beginner problem?

like image 396
ada91 Avatar asked Apr 03 '13 19:04

ada91


2 Answers

.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"
like image 144
internetoutfitters Avatar answered Oct 05 '22 05:10

internetoutfitters


Make sure you are using the latest openjdk (7 update 21, at the time of this writing) and latest JRuby (1.7.4).

Create a file called .jrubyrc in your user home folder.

add the following;

cext.enabled=true

done

like image 29
Rodrigo Dellacqua Avatar answered Oct 05 '22 04:10

Rodrigo Dellacqua