无法`gem install tiny_tds` OS X Mavericks

错误

$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

自制

即使在a之后也会出现上述错误

$brew install freetds

手动安装

$tar zxf freetds-stable.tgz

$cd freetds-0.91

$./configure

$make

$sudo make install

它似乎缺少/usr/local/lib /中的以下文件:

> libsybdb.so

相反,我有以下文件:

> libsybdb.a
> libsybdb.dylib
> libsybdb.la

研究

> https://github.com/Homebrew/homebrew/issues/24550
> ROR + Unable to install tiny_tds

我通过明确指定64位架构解决了这个问题:

$brew install freetds
$sudo ARCHFLAGS="-arch x86_64" gem install tiny_tds

原因是在宝石建造过程中,mkmf将尝试寻找32位版本的freetds,这是不可用的. mkmf.log中的错误消息说:

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
相关文章
相关标签/搜索