无法'gem install tiny_tds` OS X Mavericks [英] Unable to `gem install tiny_tds` OS X Mavericks
问题描述
错误
$ sudo gem install tiny_tds
构建原生扩展。这可能需要一段时间......
$ b 错误:安装tiny_tds时出错:
错误:未能建立宝石本地扩展。
/系统/资料库/ Frameworks / Ruby.framework /版本/2.0/usr/bin/ruby extconf.rb
在iconv.h中检查iconv_open()... no
检查iconv_open()in -liconv ... yes
检查sybfront.h ...是
检查sybdb.h ...是
在-lsybdb中检查tdsdbopen()...否
HomeBrew
即使在
$ brew安装freetds
手动安装
$ tar zxf freetds-stable.tgz
$ cd freetds-0.91
$ ./configure
$ make
$ sudo make install
它似乎缺少<$ c中的以下文件
$ b
-
libsybdb.so <$ c> / usr / local / lib /
/ code>
相反,我有以下文件:
libsybdb.a
libsybdb.dylib
libsybdb.la
研究
我通过明确指定64位体系结构解决了这个问题:
$ brew install freetds
$ sudo ARCHFLAGS = - arch x86_64gem install tiny_tds
原因是在创建gem过程中,mkmf会尝试查找32位版本的freetds,这是不可用的。 mkmf.log
中的错误消息表示:
ld:warning:忽略文件/usr/local/lib/libsybdb.dylib,文件是为x86_64构建的,而不是被链接的架构(i386):/usr/local/lib/libsybdb.dylib
架构i386的未定义符号:
_tdsdbopen,引用自:
_t in conftest-a13287.o
ld:符号(s)找不到架构i386
The Error
$ sudo gem install tiny_tds
Building native extensions. This could take a while...
ERROR: Error installing tiny_tds:
ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby extconf.rb
checking for iconv_open() in iconv.h... no
checking for iconv_open() in -liconv... yes
checking for sybfront.h... yes
checking for sybdb.h... yes
checking for tdsdbopen() in -lsybdb... no
HomeBrew
The above error occurs even after a
$ brew install freetds
Manual Installation
$ tar zxf freetds-stable.tgz
$ cd freetds-0.91
$ ./configure
$ make
$ sudo make install
It appears to be missing the following file in /usr/local/lib/
:
libsybdb.so
Instead I have the following files:
libsybdb.a
libsybdb.dylib
libsybdb.la
Research
I solved this problem by explicitly specifying the 64 bit architecture:
$ brew install freetds
$ sudo ARCHFLAGS="-arch x86_64" gem install tiny_tds
The reason is that during the gem building process, mkmf will try to look for 32 bit version of freetds, which is not available. The error message in mkmf.log
said:
ld: warning: ignoring file /usr/local/lib/libsybdb.dylib, file was built for x86_64 which is not the architecture being linked (i386): /usr/local/lib/libsybdb.dylib
Undefined symbols for architecture i386:
"_tdsdbopen", referenced from:
_t in conftest-a13287.o
ld: symbol(s) not found for architecture i386
这篇关于无法'gem install tiny_tds` OS X Mavericks的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!