2016-08-02 11 views
-1

Wenn ich gem install iconv ausführen, schlägt es wie folgt:kann ich installieren iconv nicht

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. 

Ich weiß nicht, wie dies zu beheben. Was soll ich tun?

+0

Welche Plattform/Verteilung ist das? Sie scheinen ein Paket mit der Include-Datei iconv.h zu verpassen. –

+0

Ich habe es behoben! Die zwei Optionen wurden benötigt. --with-iconv-include =/usr/local/include --with-iconv-lib =/usr/local/lib – user53216

Antwort

2

Wenn Ihr Host Ubuntu/Debian läuft:

sudo aptitude install libc6-dev 

wenn Fedora/Redhat:

sudo yum install libc6-devel 

dann mit gem install iconv wiederholen. Alle Credits gehen an @ lars-haugseth.

+0

Zweifeln, das wird funktionieren: "libticonv-dev - Texas Instruments Taschenrechner Charsets Bibliothek [Entwicklungsdateien]" –

+0

@LarsHaugseth Du hast mich, ich habe einen Tippfehler gemacht. Fest, danke. – mudasobwa

+0

Auf Ubuntu 16.04 gibt es auch kein 'libiconv-dev'. My iconv.h wird vom 'libc6-dev' Paket bereitgestellt. –