Rails: error: database configuration does not specify adapter

11,248

Phusion Passenger defaults to the "production" environment, as documented. It looks like you assume "development". In that case, set "RackEnv development".

Share:
11,248
Joseph Mouhanna
Author by

Joseph Mouhanna

Updated on June 04, 2022

Comments

  • Joseph Mouhanna
    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 and rake 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?