admin管理员组

文章数量:1244431

When I upgrade rails from 5.1.6 to 7.2 I have problem with database connection.

ActiveRecord::AdapterNotSpecified database configuration does not specify adapter

This is my database.yml

default: &default
  adapter: mysql2
  encoding: utf8mb4
  pool: 10
  username: root
  socket: /tmp/mysql.sock
  collation: utf8mb4_unicode_ci
  database: my_db
  host: localhost
  reconnect: true
  wait_timeout: 300
  
development:
  primary:
    <<: *default
  primary_replica:
    <<: *default
    replica: true

my application_record.rb

  connects_to database: {writing: :primary, reading: :primary_replica}

But when I connect to rails server it returns the above error. Why is this? It still seems to get connections from the development key even though I cleared the cache,..

本文标签: Rails 7221 ActiveRecordAdapterNotSpecifieddatabase configuration does not specify adapterStack Overflow