mysql - rake 数据库 :create generated "if you set the charset manually, make sure you have a matching collation" error

标签 mysql ruby-on-rails database rake

我在 2.3.8 版本中获得了一个 Rails 项目。当我尝试运行 rake db:create 时,出现了以下错误。

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)

然后我手动创建了数据库并尝试运行该应用程序。现在我收到了这个错误。

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

我尝试同时使用 Webrick 和 mongrel,这两个问题的原因似乎相同。

最佳答案

啊,这个错误太常见了。它的MySQL。这是 solution .根据需要更改路径。让我们知道您的 body 情况如何。一切顺利。

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

关于mysql - rake 数据库 :create generated "if you set the charset manually, make sure you have a matching collation" error,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5952265/

相关文章:

ruby-on-rails - 寻求构建电子商务 Rails 应用程序的指导

mysql - 当没有 "having"子句时, "where"和 "group by"是否完全等价?

android - 在android中的两个设备之间发送数据

mysql - 多个 MySQL 连接的问题

php - 没有重复字符的Mysql正则表达式搜索

ruby-on-rails - Uncaught ReferenceError : FluxDispatcher is not defined

html - 数据库更改时在 Django 中重新加载 HTML 表

mysql - 检查复制类型mysql

php - 如何以名称 "Anonymous"将评论保存到数据库?

ruby-on-rails - ActiveRecord 范围不起作用