2016-08-02 86 views
-1

,它如下失敗:當我運行<code>gem install iconv</code>我不能安裝的iconv

Building native extensions. This could take a while... 
ERROR: Error installing iconv: 
    ERROR: Failed to build gem native extension. 

    current directory: /home/myname/local/rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/iconv-1.0.4/ext/iconv 
/home/myname/local/rbenv/versions/2.3.1/bin/ruby -r ./siteconf20160802-38989-1ie1z24.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. 

我不知道如何解決這個問題。 我該怎麼辦?

+0

這是哪個平臺/分佈?您似乎缺少提供iconv.h包含文件的包。 –

+0

我修好了!這兩個選項是必要的。 --with-iconv-include =/usr/local/include --with-iconv-lib =/usr/local/lib – user53216

回答

2

如果你的主機運行的是Ubuntu的/ Debian的:

sudo aptitude install libc6-dev 

如果於Fedora /紅帽:

sudo yum install libc6-devel 

然後用gem install iconv重試。所有學分都會去@ lars-haugseth。

+0

懷疑:「libticonv-dev - 德州儀器計算器字符庫[開發文件]」 –

+0

@LarsHaugseth你有我,我犯了一個錯字。固定,thx。 – mudasobwa

+0

在Ubuntu 16.04上,也沒有'libiconv-dev'。我的iconv.h由'libc6-dev'包提供。 –

相關問題