在Windows上安装iconv时出现以下错误
根据用户发布的帖子here我在安装libconv后尝试了以下操作http://gnuwin32.sourceforge.net/packages/libiconv.htm
gem install iconv -v '1.0.4' -- --with-iconv-dir=C:\Program Files (x86)\GnuWin32
我没有成功,下面是输出错误。
cmd错误
C:\Users\ALilland\Documents\macros\experiments\core_scripts\app>gem install iconv -v '1.0.4' -- --with-iconv-dir=C:\Program Files (x86)\GnuWin32
Temporarily enhancing PATH to include DevKit...
Building native extensions with: '--with-iconv-dir=C:\Program Files (x86)\GnuWin32'
This could take a while...
ERROR: Error installing iconv:
ERROR: Failed to build gem native extension.
C:/Ruby22/bin/ruby.exe -r ./siteconf20160919-12804-5eyr6.rb extconf.rb --with-iconv-dir=C:\Program Files (x86)\GnuWin32
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:/Ruby22/bin/$(RUBY_BASE_NAME)
--with-iconv-dir
--with-iconv-include
--without-iconv-include=${iconv-dir}/include
--with-iconv-lib
--without-iconv-lib=${iconv-dir}/lib
--enable-config-charset
--disable-config-charset
--with-config-charset
--without-config-charset
--with-iconvlib
--without-iconvlib
extconf failed, exit code 1
Gem files will remain installed in C:/Ruby22/lib/ruby/gems/2.2.0/gems/iconv-1.0.4 for inspection.
Results logged to C:/Ruby22/lib/ruby/gems/2.2.0/extensions/x86-mingw32/2.2.0/iconv-1.0.4/gem_make.out
C:\Users\ALilland\Documents\macros\experiments\core_scripts\app>
gem_make.out
C:/Ruby22/bin/ruby.exe -r ./siteconf20160919-12804-5eyr6.rb extconf.rb --with-iconv-dir=C:\Program Files (x86)\GnuWin32
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:/Ruby22/bin/$(RUBY_BASE_NAME)
--with-iconv-dir
--with-iconv-include
--without-iconv-include=${iconv-dir}/include
--with-iconv-lib
--without-iconv-lib=${iconv-dir}/lib
--enable-config-charset
--disable-config-charset
--with-config-charset
--without-config-charset
--with-iconvlib
--without-iconvlib
extconf failed, exit code 1
答案 0 :(得分:0)
我解决了这个问题, Error while installing iconv on windows by ruby2.0.0
当gem install转到into /Ruby2.2.0/lib/ruby/gems/2.2.0/gems/iconv-1.0.4/ext/iconv
Building native extensions. This could take a while...
希望这会对某人有所帮助。