Home >Database >Mysql Tutorial >Ubuntu Ruby on Rails环境中连接MySQL时出错解决方案

Ubuntu Ruby on Rails环境中连接MySQL时出错解决方案

WBOY
WBOYOriginal
2016-06-07 16:56:321023browse

在Ubuntu系统中,Ruby on Rails环境中,安装MySQL后,连接数据库会出错,经常出现如下信息:Uninitialized Constant MysqlCompat

在Ubuntu系统中,Ruby on Rails环境中,,安装MySQL后,连接数据库会出错,经常出现如下信息:

Uninitialized Constant MysqlCompat::MysqlRes

具体处理方式是,先删除安装好的MYSQL:

sudo gem uninstall mysql

然后执行如下代码:

export ARCHFLAGS="-arch i386 -arch x86_64"

sudo gem install --no-rdoc --no-ri mysql -- --with-mysql-dir=/usr/local/mysql --with-mysql-config=/usr/local/mysql/bin/mysql_config

然后,这个问题就解决了!

linux

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn