7

我一直在尝试在装有 OSX 10.6 的 Macbook 上安装 TinyTDS gem。我成功安装了 Free TDS - 确认它可以通过以下方式工作:

tsql -H SERVER -p 1433 -U username.

我从gem install tiny_tds得到的错误是:

Building native extensions.  This could take a while...
ERROR:  Error installing tiny_tds:
    ERROR: Failed to build gem native extension.

        /Users/jason/.rvm/rubies/ruby-1.9.3-p194/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.

我试过指定 TDS 库并包含目录(/usr/local/lib 和 /usr/local/include),但没有运气。我尝试过手动以及通过自制软件从源代码重新安装 FreeTDS,但这没有任何区别。

我已经看到发布了一些类似的问题,但它们似乎引用了我似乎正在超越的定位 iconv 库的问题。

我可能忽略了任何建议或参考资料?提前致谢。

4

4 回答 4

5

Ubuntu 14.04 上的相同问题通过以下方式解决:

sudo apt-get install freetds-dev

gem install tiny_tds

日志输出:

Building native extensions.  This could take a while...
/home/david/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/ext/builder.rb:73: warning: Insecure world writable dir /mnt/datapart/david in PATH, mode 040777
Successfully installed tiny_tds-0.6.1
Parsing documentation for tiny_tds-0.6.1
Installing ri documentation for tiny_tds-0.6.1
Done installing documentation for tiny_tds after 0 seconds
1 gem installed
于 2014-04-28T12:06:25.180 回答
2

您需要使用 homebrew 安装 freetds

brew update  # always a good idea to update homebrew before installing anything!
brew install freetds
于 2014-02-18T15:31:34.570 回答
1

就我而言,似乎符号链接配置不正确,并且使用“brew link freetds”会引发需要打开一些权限的错误。我几乎尝试了其他所有方法,这终于奏效了:

devMac:0.95.18 Me$ sudo chown -R $USER /usr/local/share/doc/freetds/images
devMac:0.95.18 Me$ sudo chown -R $USER /usr/local/share/doc/freetds/reference
devMac:0.95.18 Me$ sudo chown -R $USER /usr/local/share/doc/freetds/userguide
devMac:0.95.18 Me$ sudo chown -R $USER /usr/local/share/man/man5
devMac:0.95.18 Me$ brew link --overwrite freetds
Linking /usr/local/Cellar/freetds/0.95.18... 2812 symlinks created
devMac:0.95.18 Me$ sudo gem install tiny_tds 
Building native extensions.  This could take a while...
Successfully installed tiny_tds-0.6.2
Parsing documentation for tiny_tds-0.6.2
Installing ri documentation for tiny_tds-0.6.2
Done installing documentation for tiny_tds after 0 seconds
1 gem installed

免责声明:我处于学习此框架的早期阶段,不了解使用覆盖或更改这些权限的后果。

于 2015-07-20T19:59:37.997 回答
1

就我而言,使用安装 Ruby 2.3.0是可行的brew install ruby。我从这个问题中得到了这个想法Cannot install tiny_tds on os.x 10.9.4

于 2016-04-21T03:35:47.503 回答