我的ruby on rails应用程序包含两个数据库连接,它在localhost中运行良好,但它不能用于heroku。得到此错误
/app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.2/lib/active_record/connection_adapters/connection_specification.rb:52:in 'resolve_hash_connection': database configuration does not specify adapter (ActiveRecord::AdapterNotSpecified)
的database.yml
production:
adapter: mysql2
encoding: unicode
database: first_database
pool: 5
username: root
password:
production:
adapter: mysql2
encoding: unicode
database: second_database
pool: 5
username: root
password:
由于heroku覆盖了默认的database.yml文件,我按照本教程https://roratmindfiresolutions.wordpress.com/2013/05/27/connect-to-remote-database-server-from-heroku在heroku上设置了多个数据库连接,但仍然没有变化。我正在使用rails 4.0.1
。任何帮助和建议都非常值得注意。感谢。
答案 0 :(得分:0)
请注意,在他的YAML文件中,他将其称为production
和production_sec
,而您使用production
两次。