Forum: Ruby on Rails Database error when running Test

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Al C. (Guest)
on 2007-08-01 07:43

I thought my database connection was working after I was able to migrate
my schema to the database, but after I setup a simple test and ran rake
I get the following error:

/usr/local/bin/ruby -Ilib:test
No such file or directory - /tmp/mysql.sock

My database.yml file looks like this:
  adapter: mysql
  database: emporium_development
  username: root
  password: root
  host: localhost
  socket: /Applications/MAMP/tmp/mysql/mysql.sock

Im using MAMP as my database management system.

Can someone help please?
cammo (Guest)
on 2007-08-01 10:22
(Received via mailing list)
You'll need to setup a test database as well if your trying to run
Unit Tests etc.
Rails uses different DB's for dev, test and production

Convention would be the following:
   adapter: mysql
   database: emporium_test
   username: root
   password: root
   host: localhost
   socket: /Applications/MAMP/tmp/mysql/mysql.sock

Add that to you database.yml file first and then make a new DB called
emporium_test and all should be fine.

This topic is locked and can not be replied to.