2011-02-24 151 views
2

這真是一件麻煩事。下面是從鬥爭的輸出:在Mac OS X上安裝iconv gem真的很麻煩10.6.4

checking for iconv() in iconv.h... no 
checking for iconv() in -liconv... no 

我的命令行是:

sudo gem install iconv 

「它的iconv」 收益率:

/opt/local/bin/iconv 

我真的不知道那些是什麼「檢查「線意味着在那裏。爲什麼在EARTH上iconv()不會出現在iconv.h中?對我沒有意義。 iconv.h位於/ opt/local/include中。

編輯:

下面是mkmf.log輸出:

have_func: checking for iconv() in iconv.h... -------------------- no 

    "gcc -o conftest -I. -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin10.0 -I. -I/opt/local/bin/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -arch i386 -arch x86_64 -g -Os -pipe -fno-common -DENABLE_DTRACE -fno-common -pipe -fno-common conftest.c -L. -L/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib -L/opt/local/bin/lib -L. -arch i386 -arch x86_64  -lruby -lpthread -ldl " 
    Undefined symbols for architecture i386: 
     "_libiconv", referenced from: 
      _libiconv$non_lazy_ptr in ccF0PUYQ.o 
    ld: symbol(s) not found for architecture i386 
    collect2: ld returned 1 exit status 
    Undefined symbols for architecture x86_64: 
     "_libiconv", referenced from: 
      _t in cc0k5gYm.o 
    ld: symbol(s) not found for architecture x86_64 
    collect2: ld returned 1 exit status 
    lipo: can't open input file: /var/tmp//cc3Rrwkf.out (No such file or directory) 
    checked program was: 
    /* begin */ 
    1: #include <iconv.h> 
    2: 
    3: /*top*/ 
    4: int main() { return 0; } 
    5: int t() { void ((*volatile p)()); p = (void ((*)()))iconv; return 0; } 
    /* end */ 

    "gcc -o conftest -I. -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin10.0 -I. -I/opt/local/bin/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -arch i386 -arch x86_64 -g -Os -pipe -fno-common -DENABLE_DTRACE -fno-common -pipe -fno-common conftest.c -L. -L/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib -L/opt/local/bin/lib -L. -arch i386 -arch x86_64  -lruby -lpthread -ldl " 
    conftest.c: In function 't': 
    conftest.c:5: error: too few arguments to function 'libiconv' 
    conftest.c: In function 't': 
    conftest.c:5: error: too few arguments to function 'libiconv' 
    lipo: can't figure out the architecture type of: /var/tmp//ccfQKL4Y.out 
    checked program was: 
    /* begin */ 
    1: #include <iconv.h> 
    2: 
    3: /*top*/ 
    4: int main() { return 0; } 
    5: int t() { iconv(); return 0; } 
    /* end */ 

    -------------------- 

    have_library: checking for iconv() in -liconv... -------------------- no 

    "gcc -o conftest -I. -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin10.0 -I. -I/opt/local/bin/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -arch i386 -arch x86_64 -g -Os -pipe -fno-common -DENABLE_DTRACE -fno-common -pipe -fno-common conftest.c -L. -L/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib -L/opt/local/bin/lib -L. -arch i386 -arch x86_64  -lruby -liconv -lpthread -ldl " 
    Undefined symbols for architecture x86_64: 
     "_libiconv", referenced from: 
      _t in ccorhTF7.o 
    ld: symbol(s) not found for architecture x86_64 
    collect2: ld returned 1 exit status 
    lipo: can't open input file: /var/tmp//ccqa9vmd.out (No such file or directory) 
    checked program was: 
    /* begin */ 
    1: #include <iconv.h> 
    2: 
    3: /*top*/ 
    4: int main() { return 0; } 
    5: int t() { void ((*volatile p)()); p = (void ((*)()))iconv; return 0; } 
    /* end */ 

    "gcc -o conftest -I. -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin10.0 -I. -I/opt/local/bin/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -arch i386 -arch x86_64 -g -Os -pipe -fno-common -DENABLE_DTRACE -fno-common -pipe -fno-common conftest.c -L. -L/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib -L/opt/local/bin/lib -L. -arch i386 -arch x86_64  -lruby -liconv -lpthread -ldl " 
    conftest.c: In function 't': 
    conftest.c:5: error: too few arguments to function 'libiconv' 
    conftest.c: In function 't': 
    conftest.c:5: error: too few arguments to function 'libiconv' 
    lipo: can't figure out the architecture type of: /var/tmp//cc2UrCWJ.out 
    checked program was: 
    /* begin */ 
    1: #include <iconv.h> 
    2: 
    3: /*top*/ 
    4: int main() { return 0; } 
    5: int t() { iconv(); return 0; } 
    /* end */ 

    -------------------- 
+0

您使用的是什麼版本的紅寶石? – 2011-02-24 18:56:11

+0

1.8.7修補程序級別174 – AKWF 2011-02-24 19:31:14

+0

將config.log的部分粘貼到檢查位置(通過嘗試編譯程序);你可能會發現支票壞了。 – 2011-02-25 02:40:45

回答

0

這是怪異的事情。當我去到寶石目錄並做:

ruby extconf.rb 

和:

make 

和:

make install 

則:

sudo的創業板安裝的iconv

它作品!我只是不知道它爲什麼起作用。

1

我在OS X 10.9.1上也遇到了這個錯誤。我的解決方案是重新安裝與自制軟件一起安裝的libiconv。