Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
160 views
in Technique[技术] by (71.8m points)

Ruby on Rails - Error on running rails s command

I am trying to do minor upgrade in my application. I am upgrading the ruby version from 2.3.1 to 2.3.8

On running command rails s, the following error is showing.

/home/user/.rvm/gems/ruby-2.3.8/gems/activerecord-4.2.7.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:570:in `retrieve_connection': No connection pool for PublicActivity::ORM::ActiveRecord::Activity (ActiveRecord::ConnectionNotEstablished)
        from /home/user/.rvm/gems/ruby-2.3.8/gems/activerecord-4.2.7.1/lib/active_record/connection_handling.rb:113:in `retrieve_connection'
        from /home/user/.rvm/gems/ruby-2.3.8/gems/activerecord-4.2.7.1/lib/active_record/connection_handling.rb:87:in `connection'
        from /home/user/.rvm/gems/ruby-2.3.8/gems/activerecord-4.2.7.1/lib/active_record/model_schema.rb:230:in `table_exists?'
        from /home/user/.rvm/gems/ruby-2.3.8/gems/public_activity-1.6.4/lib/public_activity/orm/active_record/activity.rb:47:in `<class:Activity>'
        from /home/user/.rvm/gems/ruby-2.3.8/gems/public_activity-1.6.4/lib/public_activity/orm/active_record/activity.rb:22:in `<module:ActiveRecord>'
        from /home/user/.rvm/gems/ruby-2.3.8/gems/public_activity-1.6.4/lib/public_activity/orm/active_record/activity.rb:19:in `<module:ORM>'
        from /home/user/.rvm/gems/ruby-2.3.8/gems/public_activity-1.6.4/lib/public_activity/orm/active_record/activity.rb:18:in `<module:PublicActivity>'
        from /home/user/.rvm/gems/ruby-2.3.8/gems/public_activity-1.6.4/lib/public_activity/orm/active_record/activity.rb:3:in `<top (required)>'
        from /home/user/.rvm/gems/ruby-2.3.8/gems/public_activity-1.6.4/lib/public_activity/orm/active_record.rb:4:in `require_relative'
        from /home/user/.rvm/gems/ruby-2.3.8/gems/public_activity-1.6.4/lib/public_activity/orm/active_record.rb:4:in `<top (required)>'
        from /home/user/.rvm/gems/ruby-2.3.8/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:274:in `require'
        from /home/user/.rvm/gems/ruby-2.3.8/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:274:in `block in require'
        from /home/user/.rvm/gems/ruby-2.3.8/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:240:in `load_dependency'
        from /home/user/.rvm/gems/ruby-2.3.8/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:274:in `require'
        from /home/user/.rvm/gems/ruby-2.3.8/gems/public_activity-1.6.4/lib/public_activity.rb:53:in `inherit_orm'
        from /home/user/.rvm/gems/ruby-2.3.8/gems/public_activity-1.6.4/lib/public_activity/models/activity.rb:4:in `<module:PublicActivity>'
        from /home/user/.rvm/gems/ruby-2.3.8/gems/public_activity-1.6.4/lib/public_activity/models/activity.rb:3:in `<top (required)>'
        from /home/user/.rvm/gems/ruby-2.3.8/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:274:in `require'
        from /home/user/.rvm/gems/ruby-2.3.8/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:274:in `block in require'
        from /home/user/.rvm/gems/ruby-2.3.8/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:240:in `load_dependency'
        from /home/user/.rvm/gems/ruby-2.3.8/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:274:in `require'
        from /home/user/test/application/engines/admin/lib/admin/activity_extension.rb:10:in `<module:Admin>'
        from /home/user/test/application/engines/admin/lib/admin/activity_extension.rb:1:in `<top (required)>'
        from /home/user/.rvm/gems/ruby-2.3.8/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:274:in `require'
        from /home/user/.rvm/gems/ruby-2.3.8/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:274:in `block in require'
        from /home/user/.rvm/gems/ruby-2.3.8/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:240:in `load_dependency'
        from /home/user/.rvm/gems/ruby-2.3.8/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:274:in `require'
        from /home/user/test/application/engines/admin/lib/admin/engine.rb:8:in `<top (required)>'
        from /home/user/test/application/engines/admin/lib/admin.rb:1:in `require'
        from /home/user/test/application/engines/admin/lib/admin.rb:1:in `<top (required)>'
        from /home/user/.rvm/gems/ruby-2.3.8/gems/bundler-1.17.3/lib/bundler/runtime.rb:81:in `require'
        from /home/user/.rvm/gems/ruby-2.3.8/gems/bundler-1.17.3/lib/bundler/runtime.rb:81:in `block (2 levels) in require'
        from /home/user/.rvm/gems/ruby-2.3.8/gems/bundler-1.17.3/lib/bundler/runtime.rb:76:in `each'
        from /home/user/.rvm/gems/ruby-2.3.8/gems/bundler-1.17.3/lib/bundler/runtime.rb:76:in `block in require'
        from /home/user/.rvm/gems/ruby-2.3.8/gems/bundler-1.17.3/lib/bundler/runtime.rb:65:in `each'
        from /home/user/.rvm/gems/ruby-2.3.8/gems/bundler-1.17.3/lib/bundler/runtime.rb:65:in `require'
        from /home/user/.rvm/gems/ruby-2.3.8/gems/bundler-1.17.3/lib/bundler.rb:114:in `require'
        from /home/user/test/application/config/application.rb:17:in `<top (required)>'
        from /home/user/.rvm/gems/ruby-2.3.8/gems/railties-4.2.7.1/lib/rails/commands/commands_tasks.rb:78:in `require'
        from /home/user/.rvm/gems/ruby-2.3.8/gems/railties-4.2.7.1/lib/rails/commands/commands_tasks.rb:78:in `block in server'
        from /home/user/.rvm/gems/ruby-2.3.8/gems/railties-4.2.7.1/lib/rails/commands/commands_tasks.rb:75:in `tap'
        from /home/user/.rvm/gems/ruby-2.3.8/gems/railties-4.2.7.1/lib/rails/commands/commands_tasks.rb:75:in `server'
        from /home/user/.rvm/gems/ruby-2.3.8/gems/railties-4.2.7.1/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
        from /home/user/.rvm/gems/ruby-2.3.8/gems/railties-4.2.7.1/lib/rails/commands.rb:17:in `<top (required)>'
        from script/rails:6:in `require'
        from script/rails:6:in `<main>'

I am unable to find the root cause. Please help!

EDIT -

These are the steps that I have followed during the upgradation process -

  1. Installed the new version of ruby using rvm

  2. Changed the ruby version in gemfile and ruby-version file

  3. Run bundle update (successfully)

  4. Run rails s (causing error)

This is the database.yml file -

default: &default
  adapter: postgresql
  encoding: unicode
  username: db_user
  password: db_pass
  host: localhost
  port: 5432
  pool: 5

development:
  <<: *default
  database: mydb_name

test:
  <<: *default
  database: mydb_name

production:
  <<: *default
  database: mydb_name
  username: db_user
  password: db_pass
question from:https://stackoverflow.com/questions/65933028/ruby-on-rails-error-on-running-rails-s-command

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

57.0k users

...