How to enable C extension support in jRuby?

2019-01-14 12:12发布

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?

2条回答
在下西门庆
2楼-- · 2019-01-14 12:21

.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"
查看更多
疯言疯语
3楼-- · 2019-01-14 12:24

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

查看更多
登录 后发表回答