Unable to `gem install tiny_tds` OS X Mavericks

為{幸葍}努か 提交于 2019-12-05 17:00:47

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

Solution

This was resolved by simply adding /opt/chef/embedded/bin to my $PATH

$ sudo nano ~/.bashrc


File Contents after change

export PATH="/opt/chef/embedded/bin:$PATH:$HOME/.rvm/bin" # Add RVM to PATH for scripting


Update $PATH

$ source ~/.bashrc


Install the gem (Make sure you've install freetds using one of the above methods)

$ sudo gem install tiny_tds


SPECIAL NOTE: This assumes you've installed the chef

$ curl -L https://www.opscode.com/chef/install.sh | sudo bash

Reference:

Apparently the command to install is below:

$ sudo gem install tiny_tds -- --with-freetds-include=/usr/local/freetds/include --with-iconv-include=/opt/chef/embedded/include --with-freetds-lib=/usr/local/freetds/lib

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!