如何在 jRuby 中启用 C 扩展支持? [英] How to enable C extension support in jRuby?

查看:26
本文介绍了如何在 jRuby 中启用 C 扩展支持?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想安装 gem,但出现以下错误:

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.

我也阅读了这个问题,但我没有甚至知道如何使用三个选项启用支持,因为我不知道如何将 -Xcext.enabled=true 传递给 JRuby 或设置 JRUBY_OPTS 或修改 .jrubyrc 以启用.

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 由 Rodrigo 建议的编辑对我不起作用(jdk 7u25/JRuby 1.7.4),但导出 JRUBY_OPTS 确实有用:

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

这篇关于如何在 jRuby 中启用 C 扩展支持?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆