【发布时间】:2014-09-11 13:22:18
【问题描述】:
我尝试将现有项目从 Rails 3.2.3 升级到 Rails 4.1.4(最新)。我更新了我的 gemfile,更新包没有问题。我也加了
config.eager_load = false
到我的环境 *.rb。当我运行服务器时,当我尝试访问第一页时出现以下错误……看起来没有连接到数据库,但我可以使用客户端访问它。我的服务目前使用 sqlite3..
ActiveRecord::ConnectionNotEstablished (ActiveRecord::ConnectionNotEstablished): activerecord (4.1.4) lib/active_record/connection_adapters/abstract/connection_pool.rb:541:in
retrieve_connection' activerecord (4.1.4) lib/active_record/connection_handling.rb:113:inretrieve_connection' activerecord (4.1.4) lib/active_record/connection_handling.rb:87:inconnection' activerecord (4.1.4) lib/active_record/query_cache.rb:51:inrestore_query_cache_settings' activerecord (4.1.4) lib/active_record/query_cache.rb:43:inrescue in call' activerecord (4.1.4) lib/active_record/query_cache.rb:32:incall' activerecord (4.1.4) lib/active_record/connection_adapters/abstract/connection_pool.rb:621:incall' actionpack (4.1.4) lib/action_dispatch/middleware/callbacks.rb:29:inblock in call' activesupport (4.1.4) lib/active_support/callbacks.rb:82:in `run_callbacks' (1.5.2) li
b/rack/runtime.rb:17:in `call' …
我的 database.yml 文件没有改变。它使用 sqlite3
# SQLite version 3.x
# gem install sqlite3
#
# Ensure the SQLite 3 gem is defined in your Gemfile
# gem 'sqlite3'
development:
adapter: sqlite3
database: db/development.sqlite3
pool: 5
timeout: 5000
# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test:
adapter: sqlite3
database: db/test.sqlite3
pool: 5
timeout: 5000
production:
adapter: sqlite3
database: db/production.sqlite3
pool: 5
timeout: 5000
【问题讨论】:
标签: ruby-on-rails activerecord sqlite