安装 dm-mysql-adapter 时出错

发布于 2024-10-11 15:26:42 字数 1503 浏览 2 评论 0原文

我对 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 补丁级别 249)[i486-linux]
宝石版本:1.3.5

I am very new to Ruby . I installed DataMapper and I am trying to install dm-mysql-adapter-1.0.2 gem . But when I try to install , I get the below error . I am using ubuntu OS .

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

Am I missing something ?

Additional information .

Ruby Version : ruby 1.8.7 (2010-01-10 patchlevel 249) [i486-linux]
Gem Version : 1.3.5

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

溺孤伤于心 2024-10-18 15:26:42

你需要安装 mysql 开发包:

sudo apt-get install libmysqlclient-dev

应该可以解决问题

You need to have mysql dev package installed:

sudo apt-get install libmysqlclient-dev

Should do the trick

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文