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\"
I ran into the same error. In my case, the problem was that I hadn't created the MySQL user who was specified in database.yml
.
mysql --user=root mysql
grant all privileges on *.* to 'user_name_here'@'localhost' identified by 'password_here';
exit;
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