0

I can connect to the db from terminal.

The rails console connects fine also and I can return objects, mod them and do what ever from there. So database.yml must be ok

But for some reason the Passenger just won't connect..

What am I missing?

Error

Ruby on Rails application could not be started

There appears to be a database problem.
Your config/database.yml may not be written correctly. Please check it and fix any     errors.
Your database schema may be out of date or nonexistant. Please run rake db:migrate to   ensure that the database schema is up-to-date.
The database server may not be running. Please check whether it's running, and start it    if  it isn't.

Error message:
Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (13)   (Mysql::Error)

Exception class:
Mysql::Error

thanks

Trevor Nowak
  • 103
  • 2

2 Answers2

0

One of two things:

  • The user that passenger is running as doesn't have permission to the socket object,

or,

  • The database isn't running.

Since you're able to connect and query from the terminal, it's probably a permission issue. What user is passenger running as, and what permissions do you get from ls -l /var/lib/mysql/?

Shane Madden
  • 114,520
  • 13
  • 181
  • 251
0

Make sure that your Rails app is actually running in the mode you want it to be running in:

grep RAILS_ENV config/environment.rb
grep RailsEnv /path/to/Apache/config

and:

egrep '^production|^development' -A6 config/database.yml
quanta
  • 51,413
  • 19
  • 159
  • 217