rake db:create generated “if you set the charset manually, make sure you have a matching collation” error

前端 未结 2 754
北恋
北恋 2021-01-12 09:16

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\"         


        
2条回答
  •  孤独总比滥情好
    2021-01-12 10:02

    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
    

提交回复
热议问题