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

时间:2021-10-08 11:19:56

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?

任何人都可以帮我解决我的初学者问题吗?

2 个解决方案

#1


20  

.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:

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

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

#2


8  

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

#1


20  

.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:

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

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

#2


8  

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