简体   繁体   中英

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?

罗德里戈建议的.jrubyrc编辑对我不起作用(jdk 7u25 / JRuby 1.7.4),但导出JRUBY_OPTS确实可以解决问题:

export JRUBY_OPTS="--1.9 -Xcext.enabled=true"

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM