我正在使用Rails 4.0.4。这个错误发生得更多,但我从4.0.1升级。
我们在生产中使用sqlite3(我甚至没有意识到)。我已经创建了一个postgres数据库之前,我想我们可以切换到postgres,如果这似乎可能是问题。会是什么呢?[如果是BC sqlite,是否有一种简单的方法将过去的数据转换为sqlite数据?])
2014-05-29T17:46:29.300034+00:00 app[web.2]: ActiveRecord::ConnectionTimeoutError (could not obtain a database connection within 5.000 seconds (waited 5.003 seconds)):
http://pastebin.com/8pZKvpUk production:
adapter: sqlite3
database: db/production.sqlite3
pool: 5
timeout: 5000
我刚刚注意到这个在Gemfile
gem 'sqlite3', :group => [:development, :test]
gem 'pg', :group => [:production]
这是否意味着我们在生产中使用pg,即使保存为。sqlite3?
Heroku不允许在生产环境中使用sqlite3
https://devcenter.heroku.com/articles/sqlite3你必须切换到PG。
检查数据库连接:
ActiveRecord::Base.connection.current_database
和使用的适配器:
ActiveRecord::Base.connection.adapter_name