2011-01-11 40 views
6

我對Ruby很新。我安裝了DataMapper,我試圖安裝dm-mysql-adapter-1.0.2 gem。但是當我嘗試安裝時,出現以下錯誤。我正在使用Ubuntu操作系統。安裝dm-mysql-adapter時出錯

[email protected]:~/Downloads$ gem install dm-mysql-adapter-1.0.2 -- --with-mysql-     lib=/usr/lib/mysql -- --with-mysql-conf=/usr/bin/mysql 
WARNING: Installing to ~/.gem since /home/vinoth/gems and 
/home/vinoth/gems/bin aren't both writable. 
WARNING: You don't have /home/vinoth/.gem/ruby/1.8/bin in your PATH, 
gem executables will not run. 
Building native extensions. This could take a while... 
ERROR: Error installing dm-mysql-adapter-1.0.2: 
ERROR: Failed to build gem native extension. 

/usr/bin/ruby1.8 extconf.rb --with-mysql-lib=/usr/lib/mysql -- --with-mysql-  conf=/usr/bin/mysql 
checking for mysql_query() in -lmysqlclient... 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 
    - ........ 


Gem files will remain installed in /home/vinoth/.gem/ruby/1.8/gems/do_mysql-0.10.2 for inspection. 
Results logged to /home/vinoth/.gem/ruby/1.8/gems/do_mysql-0.10.2/ext/do_mysql/gem_make.out 

我這麼想嗎?

的附加信息。

紅寶石版本:1.8.7紅寶石(2010-01-10 PATCHLEVEL 249)的i486-linux下]
寶石版本:1.3.5

回答

11

你需要有mysql安裝dev軟件包:

sudo apt-get install libmysqlclient-dev 

應該做的伎倆

+0

感謝那些幫助:) – vinoth 2011-01-12 03:36:09