ROR + Unable to install tiny_tds
Asked Answered
C

6

23

Here I am trying to fetch data from MS-SQL Server 2008 to my Rails application on Ubuntu 10. But I am unable to install tiny_tds. I follow the step given at github. But no response. Please guide me to setup correctly.

Used gem command :: gem install tiny_tds

This command as well :: gem install tiny_tds –with-freetds-include=/usr/local/include/freetds –with-freetds-lib=/usr/local/lib

Error :

Installing tiny_tds (0.4.5) with native extensions /home/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/rubygems/installer.rb:483:in `rescue in block in build_extensions': ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError)

/home/.rvm/rubies/ruby-1.9.2-p180/bin/ruby extconf.rb 
looking for library directory /home/.rvm/gems/ruby-1.9.2-p180@rails3/lib ... no
looking for library directory /home/.rvm/gems/ruby-1.9.2-p180@rails3/lib/freetds ... no
looking for library directory /home/.rvm/gems/ruby-1.9.2-p180@global/lib ... no
looking for library directory /home/.rvm/gems/ruby-1.9.2-p180@global/lib/freetds ... no
looking for library directory /home/.rvm/rubies/ruby-1.9.2-p180/lib ... yes
checking for main() in -lsybdb... no
looking for library directory /home/.rvm/rubies/ruby-1.9.2-p180/lib/freetds ... no
looking for library directory /home/.rvm/lib ... yes
checking for main() in -lsybdb... no
looking for library directory /home/.rvm/lib/freetds ... no
looking for library directory /home/lib ... no
looking for library directory /home/lib/freetds ... no
looking for library directory /usr/local/lib ... yes
checking for main() in -lsybdb... no
looking for library directory /usr/local/lib/freetds ... no
looking for library directory /usr/lib ... yes
checking for main() in -lsybdb... no
-----
Can not find FreeTDS's db-lib or include directory.
-----
*** 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/.rvm/rubies/ruby-1.9.2-p180/bin/ruby
    --enable-iconv
    --disable-iconv
    --enable-iconv
    --disable-iconv
    --with-freetds-dir
    --without-freetds-dir
    --with-freetds-include
    --without-freetds-include=${freetds-dir}/include
    --with-freetds-lib
    --without-freetds-lib=${freetds-dir}/lib
    --enable-lookup
    --disable-lookup
    --with-sybdblib
    --without-sybdblib
    --with-sybdblib
    --without-sybdblib
    --with-sybdblib
    --without-sybdblib
    --with-sybdblib
    --without-sybdblib
looking for library directory /usr/lib/freetds ... no
looking for library directory /usr/local/ruby/lib ... no
looking for library directory /usr/local/ruby/lib/freetds ... no


Gem files will remain installed in /home/.rvm/gems/ruby-1.9.2-p180@rails3/gems/tiny_tds-0.4.5 for inspection.
Results logged to /home/.rvm/gems/ruby-1.9.2-p180@rails3/gems/tiny_tds-0.4.5/ext/tiny_tds/gem_make.out
    from /home/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/rubygems/installer.rb:486:in `block in build_extensions'
    from /home/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/rubygems/installer.rb:446:in `each'
    from /home/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/rubygems/installer.rb:446:in `build_extensions'
    from /home/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/rubygems/installer.rb:198:in `install'
    from /home/.rvm/gems/ruby-1.9.2-p180@rails3/gems/bundler-1.0.15/lib/bundler/source.rb:101:in `block in install'
    from /home/.rvm/gems/ruby-1.9.2-p180@rails3/gems/bundler-1.0.15/lib/bundler/rubygems_integration.rb:78:in `preserve_paths'
    from /home/.rvm/gems/ruby-1.9.2-p180@rails3/gems/bundler-1.0.15/lib/bundler/source.rb:91:in `install'
    from /home/.rvm/gems/ruby-1.9.2-p180@rails3/gems/bundler-1.0.15/lib/bundler/installer.rb:58:in `block (2 levels) in run'
    from /home/.rvm/gems/ruby-1.9.2-p180@rails3/gems/bundler-1.0.15/lib/bundler/rubygems_integration.rb:93:in `with_build_args'
    from /home/.rvm/gems/ruby-1.9.2-p180@rails3/gems/bundler-1.0.15/lib/bundler/installer.rb:57:in `block in run'
    from /home/.rvm/gems/ruby-1.9.2-p180@rails3/gems/bundler-1.0.15/lib/bundler/spec_set.rb:12:in `block in each'
    from /home/.rvm/gems/ruby-1.9.2-p180@rails3/gems/bundler-1.0.15/lib/bundler/spec_set.rb:12:in `each'
    from /home/.rvm/gems/ruby-1.9.2-p180@rails3/gems/bundler-1.0.15/lib/bundler/spec_set.rb:12:in `each'
    from /home/.rvm/gems/ruby-1.9.2-p180@rails3/gems/bundler-1.0.15/lib/bundler/installer.rb:49:in `run'
    from /home/.rvm/gems/ruby-1.9.2-p180@rails3/gems/bundler-1.0.15/lib/bundler/installer.rb:8:in `install'
    from /home/.rvm/gems/ruby-1.9.2-p180@rails3/gems/bundler-1.0.15/lib/bundler/cli.rb:222:in `install'
    from /home/.rvm/gems/ruby-1.9.2-p180@rails3/gems/bundler-1.0.15/lib/bundler/vendor/thor/task.rb:22:in `run'
    from /home/.rvm/gems/ruby-1.9.2-p180@rails3/gems/bundler-1.0.15/lib/bundler/vendor/thor/invocation.rb:118:in `invoke_task'
    from /home/.rvm/gems/ruby-1.9.2-p180@rails3/gems/bundler-1.0.15/lib/bundler/vendor/thor.rb:246:in `dispatch'
    from /home/.rvm/gems/ruby-1.9.2-p180@rails3/gems/bundler-1.0.15/lib/bundler/vendor/thor/base.rb:389:in `start'
    from /home/.rvm/gems/ruby-1.9.2-p180@rails3/gems/bundler-1.0.15/bin/bundle:13:in `<top (required)>'
    from /home/.rvm/gems/ruby-1.9.2-p180@rails3/bin/bundle:19:in `load'
    from /home/.rvm/gems/ruby-1.9.2-p180@rails3/bin/bundle:19:in `<main>'
Calculating answered 23/9, 2011 at 6:28 Comment(1)
What is the exact error that you get when installing the gem?Dodgem
J
54

Did you install freeTDS prior to install the gem?

sudo apt-get install freetds-dev

Then

gem install tiny_tds
Jackinthebox answered 23/9, 2011 at 9:29 Comment(2)
you saved my day :)Polly
Those using CentOS can run yum install freetds-devel -ySwatow
D
46

The answer above is correct, this is just an additional note for those mac folks that prefer homebrew

It command is essentially the exact same:

brew install freetds
Davey answered 13/11, 2012 at 21:55 Comment(2)
This answer doesn't work for me: #24394976Wengert
gem install tiny_tds -- --with-freetds-dir=/opt/homebrew/Cellar/freetds/1.2.21Caseworm
R
7

As ar3 says, the answer above is correct. For those on CentOS, the RPM is freetds-devel, not freetds-dev (in case you're as soft with sysadmin as I am).

yum install freetds-devel
Rooftree answered 26/9, 2013 at 15:25 Comment(0)
S
1

For mac users first install freetds by gem install tiny_tds

then get the freetds path by ls /opt/homebrew/Cellar/freetds

my version is 1.3.10

then

 gem install tiny_tds -- --with-freetds-dir=/opt/homebrew/Cellar/freetds/1.3.10
Shelby answered 19/4, 2022 at 1:27 Comment(1)
This worked perfectly for me on a Mac, except Step 1 was: homebrew install freetdsClaro
B
0

Try with this,

Download freetds from following link and install it

freetds download link

Install with following instructions:

cd /home/user/Downloads/
tar -zxvf freetds-1.00.23.tar.gz

Then

cd freetds-1.00.23/
./configure
make
sudo make install 

After freetds installation complete, try with bundle install

This will solve freetds dependency issue.

Bromberg answered 12/10, 2017 at 6:34 Comment(0)
U
0

In my case MacOS, it can not install due to this error

find_header('sybfront.h')
...
Not found sybfront.h

How to resolve?

[1] brew install freetds
 => In the log will have the install path like this:
 /opt/homebrew/Cellar/freetds/1.4.14

[2] export FREETDS_DIR="/opt/homebrew/Cellar/freetds/1.4.14"

=> The issue will be resolved

Ultrasound answered 21/5 at 11:13 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.