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

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:


On Sun, Dec 14, 2014 at 2:00 AM, Michael D. [email protected]

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

​Is mysql installed on the machine?​

On Sat, Dec 13, 2014 at 12:30 PM, Michael D. [email protected]

  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:

Hassan S. ------------------------ [email protected]

twitter: @hassan

Thanks for the help! It is greatly appreciated.

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

He said that mysql had already been installed.

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

mysql.server start

Then I got another error:
Unknown database ‘simple_cms_development’

this was resolved by typing the following into terminal:
bin/rake db:create db:migrate

The problem is resolved. Now I am able to successfully move forward with
the class.

Thanks again