ActiveRecord::AdapterNotSpecified database configuration does not specify adapter

后端 未结 7 1776
清歌不尽
清歌不尽 2020-12-06 08:52

When I use heroku open my web app works fine but when I\'m using rails s (localhost) I am running into this error:

ActiveRecord::AdapterNotSpecified database         


        
7条回答
  •  广开言路
    2020-12-06 09:38

    For you app to work locally you need to:

    1. Install Postgresql on your machine
    2. Create a database for your development needs (let's call it my_app_development)
    3. Change your database.yml to:

      default: &default
        adapter: postgresql
        encoding: unicode
        # For details on connection pooling, see rails configuration guide
        # http://guides.rubyonrails.org/configuring.html#database-pooling
        pool: 5
      
      development:
        <<: *default
        database: my_app_development
      
    4. run rake db:migrate

提交回复
热议问题