0

安裝gem ruby​​-odbc -v'0.99995'時沒有出現錯誤。 請幫我解決這個錯誤。我嘗試了很多東西,但沒有奏效。gem install ruby​​-odbc -v'0.99995'無法安裝在Ubuntu 11.10上

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

回答

6

您是否嘗試過在安裝UNIX ODBC開發文件?

sudo apt-get install unixodbc-dev 
+0

乾杯!我也有這個問題,上面的工作完美。 – Bealer

+0

謝謝!它爲我工作... – Anuja

3

如果你在OS X和有這個問題嘗試

brew install unixodbc 

那麼你應該能夠

gem install ruby-odbc