Windows下执行gem install 时ERROR: Failed to build gem native extension的解决办法.

最近在整移动端的自动化测试, 安装devkit 后 执行gem install json 老是报错:

Fetching: rdiscount-2.1.8.gem (100%)
Temporarily enhancing PATH to include DevKit...
Building native extensions.  This could take a while...
ERROR:  Error installing rdiscount:
        ERROR: Failed to build gem native extension.

    C:/Ruby200-x64/bin/ruby.exe extconf.rb
checking for random()... no
checking for srandom()... no
checking for rand()... yes
checking for srand()... yes
checking size of unsigned long... 4
checking size of unsigned int... failed
checking size of unsigned short... 2
no int with size 2
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
        --with-opt-dir
        --without-opt-dir
        --with-opt-include
        --without-opt-include=${opt-dir}/include
        --with-opt-lib
        --without-opt-lib=${opt-dir}/lib
        --with-make-prog
        --without-make-prog
        --srcdir=.
        --curdir
        --ruby=C:/Ruby200-x64/bin/ruby
        --with-rdiscount-dir
        --without-rdiscount-dir
        --with-rdiscount-include
        --without-rdiscount-include=${rdiscount-dir}/include
        --with-rdiscount-lib
        --without-rdiscount-lib=${rdiscount-dir}/


Gem files will remain installed in C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/rdisc
ount-2.1.8 for inspection.
Results logged to C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/rdiscount-2.1.8/ext/ge
m_make.out


百般无奈, 上网查找解决办法,找打的大部分都是IOS系统或者是Linux系统的解决办法,苦恼很久,最后发现需要使用:

gem install json –v 1.8.3 -- --use-system-libraries

提供解决办法的人说是其libxml2与某些系统有冲突,附原帖地址如下:

http://stackoverflow.com/questions/24251494/nokogiri-gem-installation-error





  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值