2

安装 gem ruby​​-odbc -v'0.99995' 时我没有收到错误。请帮我解决这个错误。我尝试了很多东西,但没有奏效。

Building native extensions.  This could take a while...
ERROR:  Error installing ruby-odbc:
    ERROR: Failed to build gem native extension.

/home/sheetal/.rvm/rubies/ruby-1.8.7-p371/bin/ruby extconf.rb
checking for version.h... yes
checking for sql.h... no
*** 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/sheetal/.rvm/rubies/ruby-1.8.7-p371/bin/ruby
    --with-odbc-dir
    --without-odbc-dir
    --with-odbc-include
    --without-odbc-include=${odbc-dir}/include
    --with-odbc-lib
    --without-odbc-lib=${odbc-dir}/lib
ERROR: sql.h not found

我正在使用 ruby​​ 1.8.7 & rails2

4

2 回答 2

14

您是否尝试过安装 unix odbc 开发文件?

sudo apt-get install unixodbc-dev
于 2013-06-24T08:18:51.397 回答
10

如果您使用的是 OS X 并遇到此问题,请尝试

    brew install unixodbc

那么你应该能够

    gem install ruby-odbc
于 2015-06-21T01:48:17.300 回答