Rails / ActiveRecord - AdapterNotSpecified, even though it is

前端 未结 2 2002
情歌与酒
情歌与酒 2021-01-12 03:37

I\'m doing the Ruby on Rails Tutorial. For the first three chapters it uses SQLite, but later it suggests using PostgreSQL on development for easier Heroku deploys. After ed

2条回答
  •  暗喜
    暗喜 (楼主)
    2021-01-12 04:21

    You did not define the database for the test environment. Your database.yml file should look like:

    development:
      adapter: postgresql
      host: localhost
      username: nekkoru
      password: derpderp
      database: development
      encoding: UTF8
    
    test:
      adapter: postgresql
      host: localhost
      username: nekkoru
      password: derpderp
      database: test        # or whatever the name is
      encoding: UTF8
    

提交回复
热议问题