简体   繁体   English

如何在jRuby中启用C扩展支持?

[英]How to enable C extension support in jRuby?

I want to install a gem but I get the following error: 我想安装一个gem,但是我收到以下错误:

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. 我也用同样的问题读了这个问题,但我甚至不知道如何用三个选项启用支持,因为我不知道如何将-Xcext.enabled=true传递给JRuby或设置JRUBY_OPTS或修改.jrubyrc启用。

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). 确保您使用的是最新的openjdk(撰写本文时为7更新21)和最新的JRuby(1.7.4)。

Create a file called .jrubyrc in your user home folder. 在用户主文件夹中创建名为.jrubyrc的文件。

add the following; 添加以下内容;

cext.enabled=true

done DONE

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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