Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ruby/24.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby 安装dm-mysql适配器时出错_Ruby_Datamapper - Fatal编程技术网

Ruby 安装dm-mysql适配器时出错

Ruby 安装dm-mysql适配器时出错,ruby,datamapper,Ruby,Datamapper,我对Ruby很陌生。我安装了DataMapper,并尝试安装dm-mysql-adapter-1.0.2 gem。但是当我尝试安装时,我得到以下错误。我正在使用ubuntu操作系统 vinoth@vinoth-laptop:~/Downloads$ gem install dm-mysql-adapter-1.0.2 -- --with-mysql- lib=/usr/lib/mysql -- --with-mysql-conf=/usr/bin/mysql

我对Ruby很陌生。我安装了DataMapper,并尝试安装dm-mysql-adapter-1.0.2 gem。但是当我尝试安装时,我得到以下错误。我正在使用ubuntu操作系统

vinoth@vinoth-laptop:~/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
我错过什么了吗

补充资料

Ruby版本:Ruby 1.8.7(2010-01-10 patchlevel 249)[i486 linux]

Gem版本:1.3.5

您需要安装mysql开发包:

sudo apt-get install libmysqlclient-dev
我们应该这样做