Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

database configuration does not specify adapter

I'm getting this error when I'm trying to connect to a mysql database. The problem is that the application works for weeks, and then randomly I get this message. When I get this error message the application is not able to reconnect to the database until I restart it.

I'm using a configuration file to connect to the database, and the adapter is specified...the database configuration is not generated at runtime.

Do you have any idea on what is going on?

like image 823
Roberto Avatar asked Jan 05 '09 16:01

Roberto


1 Answers

when I tried to run a command line script (let's say 'my_script' here), the same error happened. The reasons were:

  1. There is only production environment there.
  2. I missed to set RAILS_ENV for the command line.

So, the following is the solution in my case:

$ RAILS_ENV=production my_script

like image 107
Fumisky Wells Avatar answered Sep 18 '22 19:09

Fumisky Wells