Topic: No such file or directory - /tmp/mysql.sock

Hi Im trying to setup Ruby/Rails on Ubuntu Edgy...

sudo apt-get install ruby ruby1.8 ruby1.8-dev rdoc ri irb
sudo apt-get install libmysql-ruby
Then downloaded and installed gem, then used gem to download/install Rails...
I can generate Rails apps and run ruby programs so I'm fairly confident the above is okay...

The only problem I am having seems to be the database connection from ActiveRecord.

The error I get is: No such file or directory - /tmp/mysql.sock

I am sure my details in database.yml are correct.

I tried installing the mysql gem, but it failed to build. The error said

ruby extconf.rb install mysql
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lm... no
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lz... no
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lsocket... no
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lnsl... no
checking for mysql_query() in -lmysqlclient... no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers.  Check the mkmf.log file for more
details.  You may need configuration options.


Does anyone know what I am missing?

Re: No such file or directory - /tmp/mysql.sock

Read this

http://dev.rubyonrails.org/ticket/200

Re: No such file or directory - /tmp/mysql.sock

Danger actually answered this question for me in this ( http://railsforum.com/viewtopic.php?id=4184 ) thread.  You simply have to specify the path of the mysql.sock in your database.yml file.

Post #8 is the one you want to look at.

Last edited by BIGtrouble77 (2007-04-02 16:10:13)

Re: No such file or directory - /tmp/mysql.sock

Thanks, I shall try this tonight, looking at the other posts it will solve my problem. What exactly is mysql.sock, is this because I am using linux, on Windows I never needed to specify mysql.sock, I even booted in to Windows just to check the same app worked without it and it did smile