If your database connection is defined with using environmental variables, you must use Rails console as the application user. I get this error when I try to use the console as root, but my app user is an unprivileged user.