rails-sqlserver / tiny_tds

TinyTDS - Simple and fast FreeTDS bindings for Ruby using DB-Library.
Other
607 stars 189 forks source link

gem install tiny_tds on centOS fails #452

Closed ghost closed 4 years ago

ghost commented 4 years ago

On local machine (OSX) running bundle install works great. inGemfile is only have

gem 'tiny_tds'

However when deploying project to Amazon EC2 instance (centOS) getting errors

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

    current directory: /home/deployer/.rvm/gems/ruby-2.6.3/gems/tiny_tds-2.1.2/ext/tiny_tds
/home/deployer/.rvm/rubies/ruby-2.6.3/bin/ruby -I /home/deployer/.rvm/rubies/ruby-2.6.3/lib/ruby/site_ruby/2.6.0 -r ./siteconf20191228-16959-xf22gq.rb extconf.rb
checking for sybfront.h... no
checking for sybdb.h... no
checking for tdsdbopen() in -lsybdb... no
checking for dbanydatecrack() in -lsybdb... no
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.

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=/home/deployer/.rvm/rubies/ruby-2.6.3/bin/$(RUBY_BASE_NAME)
    --help
    --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-freetds-dir
    --without-freetds-dir
    --with-freetds-include
    --without-freetds-include=${freetds-dir}/include
    --with-freetds-lib
    --without-freetds-lib=${freetds-dir}/lib
    --with-sybdblib
    --without-sybdblib
    --with-sybdblib
    --without-sybdblib

To see why this extension failed to compile, please check the mkmf.log which can be found here:

  /home/deployer/.rvm/gems/ruby-2.6.3/extensions/x86_64-linux/2.6.0/tiny_tds-2.1.2/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in /home/deployer/.rvm/gems/ruby-2.6.3/gems/tiny_tds-2.1.2 for inspection.
Results logged to /home/deployer/.rvm/gems/ruby-2.6.3/extensions/x86_64-linux/2.6.0/tiny_tds-2.1.2/gem_make.out

How to simply make bundle install work?

aharpervc commented 4 years ago

The logs ask this question:

Failed! Do you have FreeTDS 0.95.80 or higher installed?

What is the answer? 🤔

kakashysen commented 4 years ago

I have a lot of problems like this. I solved this issue using docker but I think maybe you need to install some dependencies like freetds, I'm using this version http://www.freetds.org/files/stable/freetds-1.00.92.tar.gz

hope this will be useful

wpolicarpo commented 4 years ago

As said above, you will need to install freetds before installing tiny_tds. See here.