开发者

Problem installing tiny_tds gem in rails 3

I have succesfully installed free_tds on my mac and can use tsql to access the db and query tables. However when I try to use the gem tiny_tds gem on rails 3 I get the following error:

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

        /Users/gugguson/.rvm/rubies/ruby-1.9.2-p290/bin/ruby extconf.rb 
extconf.rb:12: warning: Insecure world writable dir /usr/local/bin in PATH, mode 040777
looking for library directory /Users/gugguson/.rvm/gems/ruby-1.9.2-p290@rails31/lib ... no
looking for library directory /Users/gugguson/.rvm/gems/ruby-1.9.2-p290@rails31/lib/freetds ... no
looking for library directory /Users/gugguson/.rvm/gems/ruby-1.9.2-p290@global/lib ... no
looking for library directory /Users/gugguson/.rvm/gems/ruby-1.9.2-p290@global/lib/freetds ... no
looking for library directory /Users/gugguson/.rvm/rubies/ruby-1.9.2-p290/lib ... yes
checking for main() in -lsybdb... no
looking for library directory /Users/gugguson/.rvm/rubies/ruby-1.9.2-p290/lib/freetds ... no
looking for library directory /Users/gugguson/.rvm/lib ... yes
checking for main() in -lsybdb... no
looking for library directory /Users/gugguson/.rvm/lib/freetds ... no
looking for library directory /usr/lib ... yes
checking for main() in -lsybdb... no
looking for library directory /usr/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/X11/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=/Users/gugguson/.rvm/rubies/ruby-1.9.2-p290/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
    --with-sybdblib
    --without-sybdblib
looking for library directory /usr/X11/lib/freetds ... no


Gem files will remain installed in /Users/gugguson/.rvm/gems/ruby-1.9.2-p290@rails31/gems/tiny_tds-0.4.5 for inspection.
Results logged to /Users/gugguson/.rvm/gems/ruby-1.9.2-p290@rails31/gems/tiny_tds-0.4.5/ext/tiny_tds/gem_make.out
    from /Users/gugguson/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:530:in `block in build_extensions'
    from /Users/gugguson/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:505:in `each'
    from /Users/gugguson/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rub开发者_运维技巧ygems/installer.rb:505:in `build_extensions'
    from /Users/gugguson/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:180:in `install'
    from /Users/gugguson/.rvm/gems/ruby-1.9.2-p290@rails31/gems/bundler-1.0.15/lib/bundler/source.rb:101:in `block in install'
    from /Users/gugguson/.rvm/gems/ruby-1.9.2-p290@rails31/gems/bundler-1.0.15/lib/bundler/rubygems_integration.rb:78:in `preserve_paths'
    from /Users/gugguson/.rvm/gems/ruby-1.9.2-p290@rails31/gems/bundler-1.0.15/lib/bundler/source.rb:91:in `install'
    from /Users/gugguson/.rvm/gems/ruby-1.9.2-p290@rails31/gems/bundler-1.0.15/lib/bundler/installer.rb:58:in `block (2 levels) in run'
    from /Users/gugguson/.rvm/gems/ruby-1.9.2-p290@rails31/gems/bundler-1.0.15/lib/bundler/rubygems_integration.rb:93:in `with_build_args'
    from /Users/gugguson/.rvm/gems/ruby-1.9.2-p290@rails31/gems/bundler-1.0.15/lib/bundler/installer.rb:57:in `block in run'
    from /Users/gugguson/.rvm/gems/ruby-1.9.2-p290@rails31/gems/bundler-1.0.15/lib/bundler/spec_set.rb:12:in `block in each'
    from /Users/gugguson/.rvm/gems/ruby-1.9.2-p290@rails31/gems/bundler-1.0.15/lib/bundler/spec_set.rb:12:in `each'
    from /Users/gugguson/.rvm/gems/ruby-1.9.2-p290@rails31/gems/bundler-1.0.15/lib/bundler/spec_set.rb:12:in `each'
    from /Users/gugguson/.rvm/gems/ruby-1.9.2-p290@rails31/gems/bundler-1.0.15/lib/bundler/installer.rb:49:in `run'
    from /Users/gugguson/.rvm/gems/ruby-1.9.2-p290@rails31/gems/bundler-1.0.15/lib/bundler/installer.rb:8:in `install'
    from /Users/gugguson/.rvm/gems/ruby-1.9.2-p290@rails31/gems/bundler-1.0.15/lib/bundler/cli.rb:270:in `update'
    from /Users/gugguson/.rvm/gems/ruby-1.9.2-p290@rails31/gems/bundler-1.0.15/lib/bundler/vendor/thor/task.rb:22:in `run'
    from /Users/gugguson/.rvm/gems/ruby-1.9.2-p290@rails31/gems/bundler-1.0.15/lib/bundler/vendor/thor/invocation.rb:118:in `invoke_task'
    from /Users/gugguson/.rvm/gems/ruby-1.9.2-p290@rails31/gems/bundler-1.0.15/lib/bundler/vendor/thor.rb:246:in `dispatch'
    from /Users/gugguson/.rvm/gems/ruby-1.9.2-p290@rails31/gems/bundler-1.0.15/lib/bundler/vendor/thor/base.rb:389:in `start'
    from /Users/gugguson/.rvm/gems/ruby-1.9.2-p290@rails31/gems/bundler-1.0.15/bin/bundle:13:in `<top (required)>'
    from /Users/gugguson/.rvm/gems/ruby-1.9.2-p290@rails31/bin/bundle:19:in `load'
    from /Users/gugguson/.rvm/gems/ruby-1.9.2-p290@rails31/bin/bundle:19:in `<main>'

Does anybody know what can be causing this?


The message Can not find FreeTDS's db-lib or include directory says that you have to install FreeTDS.

If you are using Homebrew you can easily install FreeTDS like this:

brew install freetds

Hope it helps.


Or in linux install FreeTDS like this:

sudo apt-get install freetds-dev

:)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜