我们正在使用activerecord-sqlserver-adapter
Rails 4 的适配器与 SQL Server 数据库通信。此适配器需要tiny_tds
gem。为了安装tiny_tds
,您需要freetds
在系统上安装,因为它在 gem 编译期间使用。
在我的系统上,我安装了 RVM 和 homebrew。我已经brew install freetds
并确认它可以正常工作tsql -C
并实际连接到 SQL Server。据我了解,这意味着freetds
“安装”在我的机器上并且可以正常工作。
但是,每次我做一个gem install tiny_tds
if 抱怨freetds is missing
我已经尝试了几个参数选项来“链接”到正确的文件,但似乎没有什么对我有用。我已经花了几个小时在谷歌上搜索并查看 gem 作者的著作。我正在与之合作的其他一些开发人员具有此功能,但我正在建立一个新环境,由于某种原因无法使其正常工作。他们也已经对此进行了调查,但不确定问题出在哪里。
似乎tiny_tds
gem的安装只是不知道freetds
系统上实际安装了它。
在旁注中,我也看过mini_portile
它也没有正常工作......因为我已经在当前路径上花费了几个小时,我想在切换到调查之前弄清楚这一点mini_portile
。
这是安装的输出:
$ 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
-----
freetds is missing.
-----
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby
--enable-lookup
--disable-lookup
--with-iconv-dir
--without-iconv-dir
--with-iconv-include
--without-iconv-include=${iconv-dir}/include
--with-iconv-lib
--without-iconv-lib=${iconv-dir}/
--with-freetds-dir
--without-freetds-dir
--with-freetds-include
--without-freetds-include=${freetds-dir}/include
--with-freetds-lib
--without-freetds-lib=${freetds-dir}/
--with-iconvlib
--without-iconvlib
--with-sybdblib
--without-sybdblib
Gem files will remain installed in /Library/Ruby/Gems/2.0.0/gems/tiny_tds-0.6.2 for inspection.
Results logged to /Library/Ruby/Gems/2.0.0/gems/tiny_tds-0.6.2/ext/tiny_tds/gem_make.out