Goksel-Eryigits-Mac-mini:blog geryit$ rake db:migrate --trace
(in /Users/geryit/Sites/blog)
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:migrate
rake aborted!
Client does not support authentication protocol requested by server; consider upgrading MySQL client
/Users/geryit/.rvm/rubies/ruby-1.8.7-p330/lib/ruby/1.8/mysql.rb:453:in `read'
/Users/geryit/.rvm/rubies/ruby-1.8.7-p330/lib/ruby/1.8/mysql.rb:130:in `real_connect'
/Users/geryit/.rvm/gems/ruby-1.8.7-p330/gems/activerecord-3.0.3/lib/active_record/connection_adapters/mysql_adapter.rb:600:in `connect'
/Users/geryit/.rvm/gems/ruby-1.8.7-p330/gems/activerecord-3.0.3/lib/active_record/connection_adapters/mysql_adapter.rb:164:in `initialize
.
.
.
的database.yml
development:
adapter: mysql
encoding: utf8
database: test
pool: 5
username: root
password:
socket: /tmp/mysql.sock
答案 0 :(得分:11)
你定义了
吗?gem 'mysql2'
Gemfile中的?对于Rails 3和Bundler,仅安装gem是不够的,但要将它包含在Gemfile中。
答案 1 :(得分:6)
他们现在一起工作没有任何问题。问题是Mysql版本和mysql gem标志。我删除了MYSQL 5.5并重新安装了Mysql 5.1。一切都是固定的。感谢。
我写了一篇关于安装的博文,它可能会有所帮助:https://geryit.com/blog/installing-mysql-with-rails-on-mac-os-x-snow-leopard/
答案 2 :(得分:2)
尝试卸载mysql
gem。它可能与您在mysql2
中使用的database.yml
宝石相冲突。
答案 3 :(得分:1)
我在Snow Leopard和Rails上获得了'未初始化的常量Mysql'3.在Gemfile中添加'mysql'gem为我修复了它。