mysql - 尝试为 rails 安装 mysql 支持时出错

标签 mysql ruby-on-rails ruby rubygems

Ruby 版本:1.8.7(2013-06-27 补丁级别 374)[x86_64-linux] rails 版本:2.3.5 操作系统:云 Linux 64 位

我正在尝试安装 mysql gem 以获得对 rails 的支持,命令如下,

gem install mysql -- --with-mysql-config=/usr/lib64/mysql/mysql_config

出现以下错误,

Building native extensions.  This could take a while...
ERROR:  Error installing mysql:
ERROR: Failed to build gem native extension.

/usr/local/rvm/rubies/ruby-1.8.7-p374/bin/ruby extconf.rb --with-mysql-                                config=/usr/lib64/mysql/mysql_config
extconf.rb:5: command not found: /usr/lib64/mysql/mysql_config --cflags
*** 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/local/rvm/rubies/ruby-1.8.7-p374/bin/ruby
    --with-mysql-config


Gem files will remain installed in /usr/local/rvm/gems/ruby-1.8.7-p374/gems/mysql-2.9.1 for inspection.
Results logged to /usr/local/rvm/gems/ruby-1.8.7-p374/gems/mysql-2.9.1/ext/mysql_api/gem_make.out

我什至尝试寻找 mkmf.log,但找不到。 我正在尝试实现一个已经在 Cent OS 5.9 64 位中运行的 RoR 项目。此 RoR 旨在运行在以上版本的 Ruby & Rails 中,升级会产生问题。请帮助和指导我。

最佳答案

您似乎缺少库的开发部分。 你有安装 libmysqlclient 吗? 配置文件的定位命令的输出是什么?

locate mysql_config

关于mysql - 尝试为 rails 安装 mysql 支持时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23019680/

相关文章:

MySQL表内表

mysql - 两次之间的差异存储为文本

ruby-on-rails - Bundler 找不到 gem "activerecord": 的兼容版本

ruby-on-rails - Rails嵌套表单错误,子级必须存在

mysql - Rails 生产 : No such file or directory - Error opening database in production. 日志

ruby - float 、小数或整数

mysql - 如何在 MySQL 中使用列表

ruby - 按特定条件删除数组元素

Ruby 元类类层次结构

mysql - SQL查询划分字段