Install the tiny_tds gem on Mac OS X

Install the tiny_tds MS SQL Server GEM on Mac OS X.

I kept getting this annoying error


$ gem install tiny_tds -- --with-iconv-include=/usr/local/include/ --with-iconv-lib=/usr/local/lib/
Building native extensions with: '--with-iconv-include=/usr/local/include/ --with-iconv-lib=/usr/local/lib/'
This could take a while...
ERROR:  Error installing tiny_tds:
ERROR: Failed to build gem native extension.

    /Users/zhangj/.rvm/rubies/ruby-1.9.3-p448/bin/ruby extconf.rb --with-iconv-include=/usr/local/include/ --with-iconv-lib=/usr/local/lib/
checking for iconv_open() in iconv.h... no
checking for iconv_open() in -liconv... no
-----
libiconv 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
--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=/Users/zhangj/.rvm/rubies/ruby-1.9.3-p448/bin/ruby
--enable-lookup
--disable-lookup
--with-iconv-dir
--without-iconv-dir
--with-iconv-include=${iconv-dir}/include
--with-iconv-lib=${iconv-dir}/lib
--with-freetds-dir
--without-freetds-dir
--with-freetds-include
--without-freetds-include=${freetds-dir}/include
--with-freetds-lib
--without-freetds-lib=${freetds-dir}/lib
--with-iconvlib
--without-iconvlib
------------------------------

How to resolve this:

Download the FreeTDS tar file => freetds-stable.tgz
ftp://ftp.astron.com/pub/freetds/stable/freetds-stable.tgz, http://freetds.schemamania.org/
build the package with the usual
./configure
make
then as root, 
make install
make clean

Download the tar file for iconv => libiconv-1.14.tar.gz or the latest
http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gz, http://www.gnu.org/software/libiconv/
./configure
make
then as root, 
make install
make clean




$ gem install tiny_tds -- --with-freetds-include=/usr/local/include --with-freetds-lib=/usr/local/lib --with-iconv-include=/usr/local/include --with-iconv-lib=/usr/local/lib/
Building native extensions with: '--with-freetds-include=/usr/local/include --with-freetds-lib=/usr/local/lib --with-iconv-include=/usr/local/include --with-iconv-lib=/usr/local/lib/'
This could take a while...
Successfully installed tiny_tds-0.6.1
1 gem installed




Comments

Popular posts from this blog

Find countries in a file's text using regular expressions and Perl

Make links active in Excel 2007