【问题标题】:Error installing TinyTDS on OSX 10.6 via gem install tiny_tds通过 gem install tiny_tds 在 OSX 10.6 上安装 TinyTDS 时出错
【发布时间】:2012-08-16 02:22:03
【问题描述】:

我一直在尝试在装有 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 库的问题。

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

【问题讨论】:

    标签: freetds tiny-tds


    【解决方案1】:

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

    【讨论】:

      【解决方案2】:

      在我的情况下,符号链接似乎没有正确配置,并且使用“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
      

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

      【讨论】:

        【解决方案3】:

        你需要用 homebrew 安装 freetds

        brew update  # always a good idea to update homebrew before installing anything!
        brew install freetds
        

        【讨论】:

          【解决方案4】:

          在 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-12-24
            • 1970-01-01
            • 2011-08-11
            • 1970-01-01
            • 1970-01-01
            • 2011-02-21
            • 1970-01-01
            • 1970-01-01
            • 2011-05-24
            相关资源
            最近更新 更多