我试图连接到脚本中的不同数据库,但我得到了ActiveRecord::ConnectionNotEstablished: No connection pool for 'ActiveRecord::Baseconnects_to shards: { writing: :primary, reading: :onshore }我试图通过在下面的循环中连接到这三个不同的数据库来进行一些处理
ActiveRecord::Base.connected_to(role: :reading, shard: :main) d
# and re-open them in the resque worker parent ActiveRecord/home/ubuntu/.rvm/gems/ruby-2.0.0-p451@notification-engine/gems/activerecord-4.1.7/lib/active_record/ActiveRecord::Base.co