Facing issue to install ruby gem iconv

786 views
Skip to first unread message

javeds...@gmail.com

unread,
Jun 4, 2016, 1:34:25 AM6/4/16
to RubyInstaller
I am running with issue while installing iconv ruby gem 

Ruby version:
1.ruby 2.0.0p643 (2015-02-25) [i386-mingw32]
2. Environment 64 bit window machine.

I tried below commands:

1. gem install iconv 
2. Download iconv lib and run command:  gem install iconv -- --with-curl-lib=C:\Users\Admin\Downloads\mingw64\lib --with-curl-include=C:\Users\Admin\Downloads\mingw64\include

Please help me on how to setup.

Error Message:

Temporarily enhancing PATH to include DevKit...
Building native extensions with: '--with-curl-lib=C:\Users\Admin\Downloads\mingw
64\lib --with-curl-include=C:\Users\Admin\Downloads\mingw64\include'
This could take a while...
ERROR:  Error installing iconv:
        ERROR: Failed to build gem native extension.

    current directory: C:/RUBY200/lib/ruby/gems/2.0.0/gems/iconv-1.0.4/ext/iconv

C:/RUBY200/bin/ruby.exe -r ./siteconf20160604-1700-1r150om.rb extconf.rb --with-
curl-lib=C:\Users\Admin\Downloads\mingw64\lib --with-curl-include=C:\Users\Admin
\Downloads\mingw64\include
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:/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

To see why this extension failed to compile, please check the mkmf.log which can
 be found here:

  C:/RUBY200/lib/ruby/gems/2.0.0/extensions/x86-mingw32/2.0.0/iconv-1.0.4/mkmf.l
og

extconf failed, exit code 1

Gem files will remain installed in C:/RUBY200/lib/ruby/gems/2.0.0/gems/iconv-1.0
.4 for inspection.
Results logged to C:/RUBY200/lib/ruby/gems/2.0.0/extensions/x86-mingw32/2.0.0/ic
onv-1.0.4/gem_make.out 

Tsuyoshi Morita

unread,
Jun 5, 2016, 9:36:57 AM6/5/16
to RubyInstaller
I don't use the iconv gems. But I managed to install it.

The RubyInstaller 2.0.0 package still has  its own libiconv-2.dll.
Using the same toolchain which built the binary is the first, and maybe the only, option.
The converse is also true.

Download the libiconv-1.14-x86-windows.tar.lzma from following URL
and unpack it using 7-Zip.

http://dl.bintray.com/oneclick/OpenKnapsack/x86/:libiconv-1.14-x86-windows.tar.lzma

I unpacked it and renamed the root directory to C:/DevKit-mingw64-32/home/tsuyoshi/libiconv-1.14.

C:\DevKit-mingw64-32\home\tsuyoshi>gem i iconv -- --with-opt-dir=C:/DevKit-mingw64-32/home/tsuyoshi/libiconv-1.14
Building native extensions with: '--with-opt-dir=C:/DevKit-mingw64-32/home/tsuyoshi/libiconv-1.14'

This could take a while...
Successfully installed iconv-1.0.4
1 gem installed

C:\DevKit-mingw64-32\home\tsuyoshi>ruby --version
ruby 2.0.0p648 (2015-12-16) [i386-mingw32]


javeds...@gmail.com

unread,
Jun 6, 2016, 11:03:21 AM6/6/16
to RubyInstaller
Thanks for quick response.

Provided links is not working, could you please share correct link.

javeds...@gmail.com

unread,
Jun 6, 2016, 11:22:31 AM6/6/16
to RubyInstaller
I downloaded but still getting same error:

Tsuyoshi Morita

unread,
Jun 7, 2016, 10:38:44 AM6/7/16
to RubyInstaller
I used only 3 archive files.

  ruby-2.0.0-p648-i386-mingw32.7z,
  DevKit-mingw64-32-4.7.2-20130224-1151-sfx.exe
and
  libiconv-1.14-x86-windows.tar.lzma

All I can advice you is,
in order to isolate the problem,
it is better to start from the installation of these files.
Reply all
Reply to author
Forward
0 new messages