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

27 views
Skip to first unread message

Michael Dowell

unread,
Dec 13, 2014, 3:30:33 PM12/13/14
to rubyonra...@googlegroups.com
Hi everyone,

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

I've been going through Lynda.com tutorials and I got an error. 

I was hoping somebody could help me out :)

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 Lynda.com tutorial and I can't find anything useful on stack overflow, etc.

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

Thanks,
Michael



Ganesh Ranganathan

unread,
Dec 13, 2014, 5:42:59 PM12/13/14
to rubyonra...@googlegroups.com

On Sun, Dec 14, 2014 at 2:00 AM, Michael Dowell <moodo...@gmail.com> wrote:
Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

​Is mysql installed on the machine?​

Hassan Schroeder

unread,
Dec 13, 2014, 6:55:16 PM12/13/14
to rubyonrails-talk
On Sat, Dec 13, 2014 at 12:30 PM, Michael Dowell <moodo...@gmail.com> wrote:

> 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 :-)

--
Hassan Schroeder ------------------------ hassan.s...@gmail.com
http://about.me/hassanschroeder
twitter: @hassan

Michael Dowell

unread,
Dec 15, 2014, 12:59:07 PM12/15/14
to rubyonra...@googlegroups.com
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

____

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
-Michael

Reply all
Reply to author
Forward
0 new messages