0

我正在尝试将 rails 版本从 4.2 升级到 5.0

在执行升级步骤时,存在与数据库 (postgres) 相关的连接问题。

在运行命令rails app:update时出现以下错误

rails aborted!
ActiveRecord::ConnectionNotEstablished: No connection pool with id primary found.
/home/user/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.7.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:882:in `retrieve_connection'
/home/user/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.7.2/lib/active_record/connection_handling.rb:128:in `retrieve_connection'
/home/user/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.7.2/lib/active_record/connection_handling.rb:91:in `connection'
/home/user/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.7.2/lib/active_record/model_schema.rb:331:in `table_exists?'
/home/user/.rvm/gems/ruby-2.3.1/gems/public_activity-1.6.4/lib/public_activity/orm/active_record/activity.rb:47:in `<class:Activity>'
/home/user/.rvm/gems/ruby-2.3.1/gems/public_activity-1.6.4/lib/public_activity/orm/active_record/activity.rb:22:in `<module:ActiveRecord>'
/home/user/.rvm/gems/ruby-2.3.1/gems/public_activity-1.6.4/lib/public_activity/orm/active_record/activity.rb:19:in `<module:ORM>'
/home/user/.rvm/gems/ruby-2.3.1/gems/public_activity-1.6.4/lib/public_activity/orm/active_record/activity.rb:18:in `<module:PublicActivity>'
/home/user/.rvm/gems/ruby-2.3.1/gems/public_activity-1.6.4/lib/public_activity/orm/active_record/activity.rb:3:in `<top (required)>'
/home/user/.rvm/gems/ruby-2.3.1/gems/public_activity-1.6.4/lib/public_activity/orm/active_record.rb:4:in `require_relative'
/home/user/.rvm/gems/ruby-2.3.1/gems/public_activity-1.6.4/lib/public_activity/orm/active_record.rb:4:in `<top (required)>'
/home/user/.rvm/gems/ruby-2.3.1/gems/public_activity-1.6.4/lib/public_activity.rb:53:in `require'
/home/user/.rvm/gems/ruby-2.3.1/gems/public_activity-1.6.4/lib/public_activity.rb:53:in `inherit_orm'
/home/user/.rvm/gems/ruby-2.3.1/gems/public_activity-1.6.4/lib/public_activity/models/activity.rb:4:in `<module:PublicActivity>'
/home/user/.rvm/gems/ruby-2.3.1/gems/public_activity-1.6.4/lib/public_activity/models/activity.rb:3:in `<top (required)>'
/home/user/application/engines/common/lib/common/activity_extension.rb:10:in `require'
/home/user/application/engines/common/lib/common/activity_extension.rb:10:in `<module:Common>'
/home/user/application/engines/common/lib/common/activity_extension.rb:1:in `<top (required)>'
/home/user/application/engines/common/lib/common/engine.rb:8:in `require'
/home/user/application/engines/common/lib/common/engine.rb:8:in `<top (required)>'
/home/user/application/engines/common/lib/common.rb:1:in `require'
/home/user/application/engines/common/lib/common.rb:1:in `<top (required)>'
/home/user/.rvm/gems/ruby-2.3.1/gems/bundler-2.1.4/lib/bundler/runtime.rb:74:in `require'
/home/user/.rvm/gems/ruby-2.3.1/gems/bundler-2.1.4/lib/bundler/runtime.rb:74:in `block (2 levels) in require'
/home/user/.rvm/gems/ruby-2.3.1/gems/bundler-2.1.4/lib/bundler/runtime.rb:69:in `each'
/home/user/.rvm/gems/ruby-2.3.1/gems/bundler-2.1.4/lib/bundler/runtime.rb:69:in `block in require'
/home/user/.rvm/gems/ruby-2.3.1/gems/bundler-2.1.4/lib/bundler/runtime.rb:58:in `each'
/home/user/.rvm/gems/ruby-2.3.1/gems/bundler-2.1.4/lib/bundler/runtime.rb:58:in `require'
/home/user/.rvm/gems/ruby-2.3.1/gems/bundler-2.1.4/lib/bundler.rb:174:in `require'
/home/user/application/config/application.rb:17:in `<top (required)>'
/home/user/application/Rakefile:4:in `require'
/home/user/application/Rakefile:4:in `<top (required)>'
/home/user/.rvm/gems/ruby-2.3.1/gems/railties-5.0.7.2/lib/rails/commands/rake_proxy.rb:13:in `block in run_rake_task'
/home/user/.rvm/gems/ruby-2.3.1/gems/railties-5.0.7.2/lib/rails/commands/rake_proxy.rb:11:in `run_rake_task'
/home/user/.rvm/gems/ruby-2.3.1/gems/railties-5.0.7.2/lib/rails/commands/commands_tasks.rb:51:in `run_command!'
/home/user/.rvm/gems/ruby-2.3.1/gems/railties-5.0.7.2/lib/rails/commands.rb:18:in `<top (required)>'
script/rails:6:in `require'
script/rails:6:in `<main>'

有谁知道为什么会出现这个错误以及如何解决它?

请帮忙!

4

0 回答 0