Skip to content

Install fails when FreeTDS installed via Homebrew #508

Closed
@bemky

Description

@bemky

Environment

Operating System
ProductName: macOS
ProductVersion: 11.4
BuildVersion: 20F71

TinyTDS Version and Information

Compile-time settings (established with the "configure" script)
                            Version: freetds v1.2.18
             freetds.conf directory: /opt/homebrew/etc
     MS db-lib source compatibility: no
        Sybase binary compatibility: yes
                      Thread safety: yes
                      iconv library: yes
                        TDS version: 7.3
                              iODBC: no
                           unixodbc: yes
              SSPI "trusted" logins: no
                           Kerberos: yes
                            OpenSSL: yes
                             GnuTLS: no
                               MARS: yes

FreeTDS Version

~  % brew info freetds
freetds: stable 1.2.18 (bottled), HEAD
Libraries to talk to Microsoft SQL Server and Sybase databases
https://www.freetds.org/
/opt/homebrew/Cellar/freetds/1.2.18 (1,259 files, 14.2MB) *
  Poured from bottle on 2021-10-01 at 09:45:12
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/freetds.rb
License: LGPL-2.0-or-later
==> Dependencies
Build: pkg-config ✔
Required: openssl@1.1 ✔, unixodbc ✔
==> Options
--HEAD
	Install HEAD version
==> Analytics
install: 94,301 (30 days), 254,798 (90 days), 908,686 (365 days)
install-on-request: 29,753 (30 days), 63,114 (90 days), 183,600 (365 days)
build-error: 0 (30 days)

Description

When installing gem, I get the following error even though FreeTDS is installed

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    current directory: /opt/homebrew/lib/ruby/gems/3.0.0/gems/tiny_tds-2.1.5/ext/tiny_tds
/opt/homebrew/opt/ruby/bin/ruby -I /opt/homebrew/Cellar/ruby/3.0.1/lib/ruby/3.0.0 -r ./siteconf20211001-80117-pc99xg.rb extconf.rb
looking for freetds headers in the following directories:
 - /opt/local/include
 - /opt/local/include/freetds
 - /usr/local/include
 - /usr/local/include/freetds
looking for freetds library in the following directories:
 - /opt/local/lib
 - /opt/local/lib/freetds
 - /usr/local/lib
 - /usr/local/lib/freetds
checking for sybfront.h... no
checking for sybdb.h... no
checking for tdsdbopen() in -lsybdb... yes
checking for dbanydatecrack() in -lsybdb... yes
Failed! Do you have FreeTDS 0.95.80 or higher installed?
*** 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.

It looks like tiny_tds can't find freetds. FreeTDS is installed via homebrew in the default location where homebrew puts it. When I install gem with the following it installs correctly.

gem install tiny_tds -- --with-freetds-dir=/opt/homebrew/Cellar/freetds/1.2.18

I'm not sure exactly how to fix, but can tiny_tds use $PATH to find freetds?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions