2011-02-24 102 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。