Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rails console can't connect to database

In last days i update my OS X to Maverics. Today when i try to create new project like this:

rails new abc 

there were many problems but i install xcode and now it's work. Right now i open rails console like this:

rails console 

and then whatever i write i only see:

Loading development environment (Rails 4.0.1) 1.9.3p448 :001 > Link => Link(no database connection) 

What is wrong? Mysql is running, database exist. When i do rake db:migrate everything works fine.

like image 346
Wordica Avatar asked Nov 03 '13 16:11

Wordica


1 Answers

The console probably does have a database connection but is reporting that it doesn't.

To see if that's true, make a query in the console.

Link.count 

That fixed the false positive warning for me and a colleague.

like image 167
barelyknown Avatar answered Sep 18 '22 21:09

barelyknown