ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • 오류 : 데이터베이스 구성이 어댑터를 지정하지 않습니다.
    카테고리 없음 2020. 8. 16. 14:50

    질문

    레일 3.2.12와 루비 1.9.3에서 프로젝트를 복제했습니다.bundle install 을 성공적으로 실행 한 다음 rails s RAILS_ENV = development 를 실행하면 다음 오류가 발생합니다.

    ruby/1.9.3/gems/activerecord-3.2.12/lib/active_record/connection_adapters/abstract/connection_specification.rb:47:in `resolve_hash_connection': database configuration does not specify adapter (ActiveRecord::AdapterNotSpecified)

    나는 stackoverflow에서 찾은 모든 솔루션을 시도했지만 아무도 내 문제를 해결하지 못했습니다.postgresql 9.3 및 우분투 14.04 LTS를 사용하고 있습니다.

    여기 내 database.yml입니다.

      credentials: &config
      adapter: postgresql
      encoding: unicode
      pool: 5
      username: postgres
      password: password25
      host: localhost
    
    development:
      database: myproject_development
      <<: *config
    
    test: &test
      database: myproject_test
      <<: *config
    
    production:
      database: myproject_production
      <<: *config
    
    cucumber:
      <<: *test

    미리 감사드립니다


    답변1

    문제는 여기에서 설정 한 것 같습니다.

    credentials: &config
      adapter: postgresql
      encoding: unicode
      pool: 5
      username: postgres
      password: password25
      host: localhost

    다음과 같이 변경하십시오.

    default: &config
      adapter: postgresql
      encoding: unicode
      pool: 5
      username: postgres
      password: password25
      host: localhost

    왜 처음에 default대신 credentials 를 사용했는지 궁금합니다. 도움이되기를 바랍니다.



     

     

     

     

    출처 : https://stackoverflow.com/questions/48560248/error-database-configuration-does-not-specify-adapter

    댓글

Designed by Tistory.