The database.yml file has a hidden option for those whose mysql.sock file does not reside at the default /tmp/mysql.sock location. To change the socket, add the following line (for example) to each of the configurations in database.yml:
production: socket: /var/run/mysqld/mysqld.sock
The config directory can also be used for application configuration. For application configuration see HowtoAddYourOwnConfigInfo