通过ruby2.0.0在Windows上安装iconv时出错
通过ruby2.0.0在Windows上安装iconv时出错
我正在尝试安装iconv,但是当我运行以下命令时:
通过ruby2.0.0在Windows上安装iconv时出错
我正在尝试安装iconv,但是当我运行以下命令时:
gem install iconv
我的结果:
Temporarily enhancing Path to include DevKit... Building native extensions. This could take a while... Error : Error installing iconv: ERROR: Failed to build gem native extension. C:/Ruby/Ruby200/bin/ruby.exe -r ./siteconf20150217-3212-i8hzmh.rb extconf.rb checking for rb_enc_get() in ruby/encoding.h... yes checking for rb_sys_fail_str() in ruby.h... yes checking for iconv() in iconv.h... no checking for iconv() in -liconv... no *** 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:/Ruby/Ruby200/bin/ruby --with-iconv-dir --without-iconv-dir --with-iconv-include --without-iconv-include=${iconv-dir}/include --with-iconv-lib --without-iconv-lib=${iconv-dir}/ --enable-config-charset --disable-config-charset --with-config-charset --without-config-charset --with-iconvlib --without-iconvlib extconf Failed,exit code 1
请帮帮我!!!!
谢谢.
解决方法
我今晚遇到了这个问题(Windows 7,Ruby 1.9.3).我的解决方案如下:
>从http://gnuwin32.sourceforge.net/packages/libiconv.htm开始安装“完整包,但来源除外”
>运行gem install iconv -v’1.0.4′ – –with-iconv-dir = / path / to / GnuWin32
如果这不起作用,我也首先按照这里的说明进行操作:http://donpepeto.com/2014/09/20/fixing-c-libraries-on-your-rubyrails-install-on-windows/(从GnuWin32安装中复制/ bin,/ include和/ lib的内容)他们自己没有工作,但是一旦我运行了设置,我能够安装宝石,所以也许这有帮助.我也有一个关于丢失的.gitignore的错误,但我忽略了,再次运行gem install …它有效.