简体   繁体   English

尝试安装MySQL对Rails的支持时出错

[英]Error when trying to install mysql support for rails

Ruby version : 1.8.7 (2013-06-27 patchlevel 374) [x86_64-linux] Rails version : 2.3.5 OS: Cloud Linux 64 bit Ruby版本:1.8.7(2013-06-27补丁程序级别374)[x86_64-linux] Rails版本:2.3.5操作系统:Cloud Linux 64位

I am trying to install mysql gem inorder to get support rails, the command is as follows, 我正在尝试安装mysql gem以获得支持,命令如下:

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

am getting the following error, 出现以下错误,

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

I even tried looking for mkmf.log, but cannot find it. 我什至尝试查找mkmf.log,但找不到它。 I am trying to implement a RoR project, which already ran in Cent OS 5.9 64bit. 我正在尝试实施RoR项目,该项目已经在Cent OS 5.9 64位中运行。 This RoR is designed to be run in the above versions of Ruby & Rails, upgrading will create issues. 该RoR旨在在以上版本的Ruby&Rails中运行,升级会带来问题。 Please help and direct me. 请帮助指导我。

Seems like you are missing dev parts of libraries. 似乎您缺少库的dev部分。 Do you have libmysqlclient installed? 您是否安装了libmysqlclient? What is the output of the locate command for the config file? 配置文件的locate命令的输出是什么?

locate mysql_config

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM