我正在try 安装mysql 2.8.1 gem.我将用它在Ubuntu10.04上构建Rails 2.0.2应用程序.我会使用Ruby 1.8.7.我已经安装了开发依赖项(其他gems).由于某些原因,我无法安装它.我不知道该怎么修.请帮忙!!

当我try 安装终端时,我在终端中得到以下信息:

mohnish@pc146724-desktop:~/Downloads$ sudo gem install mysql-2.8.1.gem 
Building native extensions.  This could take a while...
ERROR:  Error installing mysql-2.8.1.gem:
    ERROR: Failed to build gem native extension.

/usr/bin/ruby1.8 extconf.rb
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lm... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lz... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lsocket... no
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lnsl... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lmygcc... no
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
    --with-make-prog
    --without-make-prog
    --srcdir=.
    --curdir
    --ruby=/usr/bin/ruby1.8
    --with-mysql-config
    --without-mysql-config
    --with-mysql-dir
    --without-mysql-dir
    --with-mysql-include
    --without-mysql-include=${mysql-dir}/include
    --with-mysql-lib
    --without-mysql-lib=${mysql-dir}/lib
    --with-mysqlclientlib
    --without-mysqlclientlib
    --with-mlib
    --without-mlib
    --with-mysqlclientlib
    --without-mysqlclientlib
    --with-zlib
    --without-zlib
    --with-mysqlclientlib
    --without-mysqlclientlib
    --with-socketlib
    --without-socketlib
    --with-mysqlclientlib
    --without-mysqlclientlib
    --with-nsllib
    --without-nsllib
    --with-mysqlclientlib
    --without-mysqlclientlib
    --with-mygcclib
    --without-mygcclib
    --with-mysqlclientlib
    --without-mysqlclientlib


Gem files will remain installed in /usr/lib/ruby/gems/1.8/gems/mysql-2.8.1 for inspection.
Results logged to /usr/lib/ruby/gems/1.8/gems/mysql-2.8.1/ext/mysql_api/gem_make.out
mohnish@pc146724-desktop:~/Downloads$ 

谢谢你的帮助!!

推荐答案

试试这个,然后安装mysql gem:

sudo apt-get install libmysqlclient-dev 

如果这还不够,就这样试试

 sudo apt-get install libmysqlclient-dev libmysqlclient16 ruby-dev

Mysql相关问答推荐

正则表达式转换为MYSQL格式

MySQL 8.0.34-从后端系统管理AWS RDS上的持久连接内存使用

在 MYSQL 8 中的 JSON 字段上的 SELECT 中返回所有键及其数组项

for each 查询设置 MySQL @@session.time_zone 而不是 CONVERT_TZ 的缺点?

Mysql如何分行分词

如何编写一个查询,计算表中每个日期的一个日期加上前 4 天的记录数?

获取 TEXT 类型行的百分比

如何使用同一个表在 2 个字段上左连接

从 SQL 中的左连接和内连接中减go 计数

限制正则​​表达式中多字符通配符的范围

MySql查询无结果

MySQL按连续值和计数分组

从一个带有连接的表中删除

用序列号mysql更新列

Python MYSQL 更新语句

MySQL触发器在某些条件下防止INSERT

如何使主键从 1000 开始?

MySQL 实用程序 - ~/.my.cnf 选项文件

如何在 MySQL 中删除此索引?

在 MySQL 中的子查询上使用 GROUP_CONCAT