Проблема с установкой крошечного драгоценного камня в rails 3 - PullRequest
0 голосов
/ 07 августа 2011

Я успешно установил free_tds на моем Mac и могу использовать tsql для доступа к таблицам БД и запросов.Однако, когда я пытаюсь использовать gem tiny_tds gem на rails 3, я получаю следующую ошибку:

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/rubygems/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>'

Кто-нибудь знает, что может быть причиной этого?

Ответы [ 2 ]

2 голосов
/ 11 августа 2011

В сообщении Can not find FreeTDS's db-lib or include directory говорится, что вам необходимо установить FreeTDS.

Если вы используете Homebrew, вы можете легко установить FreeTDS следующим образом:

brew install freetds

Надеюсь, это поможет.

0 голосов
/ 08 августа 2014

Или в Linux установите FreeTDS следующим образом:

sudo apt-get install freetds-dev

:)

...