Using Xampp on Mac for Ruby on Rails

I recently installed Xampp on my mac to help with some other development work, only to find that my previous install of MySQL which I was using for Ruby on Rails development no longer worked. I was receiving errors:

ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/tmp/mysql.sock’

and

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

To fix the problem, I added the following line to config/database.yml

socket: /Applications/xampp/xamppfiles/var/mysql/mysql.sock

Huge thanks to http://soledadpenades.com/ who had the solution.



5 Responses to “Using Xampp on Mac for Ruby on Rails”

  1. sole says:

    Hey there!

    It’s great that it worked for you - sorry about the pingback not working, but I was getting a LOT of spam comments and deactivated comments in old posts :-)


  2. sole says:

    By the way - the coconut in your header is superb. Everything with coconut should have a bit of it :)


  3. @sole. Thanks for the comment, and thanks heaps for the fix! I tried to leave a comment on your blog, but since that didn’t work I did this instead. Gotta love the coconuts :)


  4. David says:

    The other thing you can do is edit the file:
    /Applications/xampp/xamppfiles/mampp

    and add the following after line 199:
    ln -s /Applications/xampp/xamppfiles/var/mysql/mysql.sock /tmp/mysql.sock

    this will create a link to mysql.sock in /tmp/ everytime mysql starts up.


  5. Colby says:

    Hi Katrina,

    I’m new to Ruby but have been using xampp for on Mac OS 10.4 for awhile. WIth your post I was able to get ruby up and running. THANKS!!


Leave a Reply