2015-10-13 142 views
4

我使用的是mac os,我想通过使用ruby驱动程序连接到sql server。我想使用tiny_tds,但是它为缺少的free_tds提供了错误,但它已经安装。怎么能通过这个?安装tiny_tds在mac os上给出错误10.10.5

~ brew install freetds 
Warning: freetds-0.91.112 already installed 
~ 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 -r ./siteconf20151013-22489-7z3h0n.rb extconf.rb 
checking for sybfront.h... yes 
checking for sybdb.h... yes 
checking for tdsdbopen() in -lsybdb... no 
Extracting freetds-0.91.112.tar.gz into tmp/x86_64-apple-darwin14/ports/freetds/0.91... OK 
Running git apply with /Library/Ruby/Gems/2.0.0/gems/tiny_tds-0.7.0/ports/patches/freetds/0.91/Makefile.in.diff... 
Running 'patch' for freetds 0.91... OK 
Running git apply with /Library/Ruby/Gems/2.0.0/gems/tiny_tds-0.7.0/ports/patches/freetds/0.91/dblib-30-char-username.diff... 
Running 'patch' for freetds 0.91... OK 
Running 'configure' for freetds 0.91... OK 
Running 'compile' for freetds 0.91... OK 
Running 'install' for freetds 0.91... OK 
Activating freetds 0.91 (from /Library/Ruby/Gems/2.0.0/gems/tiny_tds-0.7.0/ports/x86_64-apple-darwin14)... 
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 
    --help 
    --enable-lookup 
    --disable-lookup 
    --with-freetds-dir 
    --without-freetds-dir 
    --with-freetds-include 
    --without-freetds-include=${freetds-dir}/include 
    --with-freetds-lib 
    --without-freetds-lib=${freetds-dir}/ 
    --with-sybdblib 
    --without-sybdblib 
    --enable-system-freetds 
    --disable-system-freetds 
    --enable-system-iconv 
    --disable-system-iconv 
    --enable-system-openssl 
    --disable-system-openssl 
    --with-freetds-dir 
    --without-freetds-dir 
    --with-freetds-include 
    --without-freetds-include=${freetds-dir}/include 
    --with-freetds-lib 
    --without-freetds-lib=${freetds-dir}/ 
    --with-sybdblib 
    --without-sybdblib 

extconf failed, exit code 1 

回答

13

这是固定的,对我来说:

酿造安装freetds的

须藤ARCHFLAGS = “ - 拱x86_64的” 创业板安装tiny_tds

+0

谢谢,它的工作原理。 –

+1

我会猜这种东西?无论操作系统如何,他们都应该使宝石安装无缝。 关于您的解决方案,我不觉得安装宝石作为超级用户是个好主意。尽管我试图在没有sudo的情况下安装它,但它不适用于我,所以我会寻找其他解决方案。 –

-1

请参阅GitHub问题中的this answer

gem install tiny_tds -- --disable-openssl