Rails: error: database configuration does not specify adapter
Phusion Passenger defaults to the "production" environment, as documented. It looks like you assume "development". In that case, set "RackEnv development".
Joseph Mouhanna
Updated on June 04, 2022Comments
-
Joseph Mouhanna almost 2 years
The Rails application I'm developing is running fine on my local machine (MAC). When I upload it to the server (Centos 6.2 Linux, with Rails 3.2.3 and Passenger installed), and try to start the application (by entering the URL into my browser), I get the following error message:
Ruby (Rack) application could not be started There appears to be a database problem.
Your application's database configuration file might be written incorrectly. Please check it and fix any errors.
The database server may not be running. Please check whether it's running, and start it if it isn't.
Error message: database configuration does not specify adapter (ActiveRecord::AdapterNotSpecified) Exception class: ActiveRecord::AdapterNotSpecified
Note that when I ran
rake db:create
andrake db:migrate
, both of these tasks ran fine and the databases are created and migrated properly.Following is my database.yml file:
development: adapter: mysql2 encoding: utf8 reconnect: false database: acme_development pool: 5 username: root password: *********** socket: /tmp/mysql.sock test: adapter: mysql2 encoding: utf8 reconnect: false database: acme_test pool: 5 username: root password: ***************** socket: /tmp/mysql.sock
Any ideas?