error accessing the project - while trying to go through tutorial for rails 4.0

Hi everyone,

I’m new to rails and new to this group.

I’ve been going through tutorials and I got an error.

I was hoping somebody could help me out :slight_smile:

Here are the steps I’ve taken:

  1. rails new simple_cms -d mysql

  2. cd simple_cms

  3. bundle install

  4. rails s

  5. but when I check the localhost in the browser at http://localhost:3000/

I get the following error message:

Can’t connect to local MySQL server through socket ‘/tmp/mysql.sock’ (2)

Unfortunately, this isn’t covered in the tutorial and I can’t find anything useful on stack overflow, etc.

Your help to fix this problem would be greatly appreciated :slight_smile:


​Is mysql installed on the machine?​

1) rails new simple_cms -d mysql

You selected MySQL as your database server, so

Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

that means that you have to

1) have the MySQL server installed on your system
2) have it configured to be accessed via socket '/tmp/mysql.sock'
3) have it running

At least one of those three is apparently not the case :slight_smile:

Thanks for the help! It is greatly appreciated.

I spoke with the person who was helping me to set up the rails environment.

He said that mysql had already been installed.

So I typed this command into terminal in order to start mysql:
mysql.server start