rake db:create generated“如果您手动设置字符集,请确保您有一个匹配的归类”错误 [英] rake db:create generated "if you set the charset manually, make sure you have a matching collation" error

查看:263
本文介绍了rake db:create generated“如果您手动设置字符集,请确保您有一个匹配的归类”错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个rails项目在版本2.3.8。当我试图运行rake db:create,下面的错误发生。

I got a rails project in version 2.3.8. When i tried to run rake db:create, the below error occured.

Couldn't create database for {"encoding"=>"utf8", "username"=>"root", "adapter"=>"mysql", "database"=>"claims_test", "host"=>"localhost", "password"=>"root", "socket"=>"/var/run/mysqld/mysqld.sock"}, charset: utf8, collation: utf8_unicode_ci   
(if you set the charset manually, make sure you have a matching collation)

我手动创建了数据库并试图运行应用程序。现在我得到这个错误。

And I created DB manually and tried to run the application. And now I am getting this error.

/!\ FAILSAFE /!\  Tue May 10 20:38:48 +0530 2011  
  Status: 500 Internal Server Error  
  uninitialized constant MysqlCompat::MysqlRes  

我试过Webrick和mongrel

I tried with both Webrick and mongrel and it seems like same cause for both issue.

推荐答案

啊,这个错误是很常见的。其MySQL。以下是解决方案。根据需要更改路径。让我们知道您的身体情况如何。所有最好的。

Ah, this error is so common. Its MySQL. Here is the solution. Change paths as required. Let us know how you get on. All the best.

export ARCHFLAGS="-arch i386 -arch x86_64" gem install mysql -- --with-mysql-dir=/usr/local \ --with-mysql-config=/usr/local/bin/mysql_config

这篇关于rake db:create generated“如果您手动设置字符集,请确保您有一个匹配的归类”错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆