`
lxneng
  • 浏览: 188480 次
  • 性别: Icon_minigender_1
  • 来自: 火星
社区版块
存档分类
最新评论

Ruby On Rails Using MySQL database On Snow Leopard

阅读更多
又一次折腾! 在家折腾Ruby on Rails使用MySQL数据库,可是失败
$ rails blog -d mysql
$ vim blog/config/database.yml
$ cd blog; rake db:create --trace
(in /Users/eric/NetBeans_Workspace/blog)
** Invoke db:create (first_time)
** Invoke db:load_config (first_time)
** Invoke rails_env (first_time)
** Execute rails_env
** Execute db:load_config
** Execute db:create
# 出错信息
Couldn't create database for {"reconnect"=>false, "encoding"=>"utf8", "username"=>"root", "adapter"=>"mysql", "database"=>"blog_development", "host"=>"127.0.0.1", "pool"=>5, "password"=>"admin", "socket"=>"/tmp/mysql.sock"}, charset: utf8, collation: utf8_unicode_ci (if you set the charset manually, make sure you have a matching collation)


郁闷了, 我的配置都正常, 问朋友, 问google,最后卸载了mysql这个gem再重装64位的mysql gem
$ sudo gem uninstall mysql
$ sudo env ARCHFLAGS="-arch x86_64" gem install mysql -- --with-mysql-config=/usr/local/Cellar/mysql/5.1.41/bin/mysql_config


再cd blog; rake db:create就ok了

ps:我电脑没开启64位呀,奇怪

参考:http://weblog.rubyonrails.org/2009/8/30/upgrading-to-snow-leopard
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics