-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Could not load the 'postgres' Active Record adapter #403
Comments
And i found some code here def default_sequel_adapter_options(world)
db_config = ::ActiveRecord::Base.configurations.to_h[::Rails.env]
db_config['adapter'] = db_config['adapter'].gsub(/_?makara_?/, '')
# what is this mean?
db_config['adapter'] = 'postgres' if db_config['adapter'] == 'postgresql'
db_config['max_connections'] = calculate_db_pool_size(world) if increase_db_pool_size?
if db_config['adapter'] == 'sqlite3'
db_config['adapter'] = 'sqlite'
database = db_config['database']
unless database == ':memory:'
# We need to create separate database for sqlite
# to avoid lock conflicts on the database
db_config['database'] = "#{File.dirname(database)}/dynflow-#{File.basename(database)}"
end
end
db_config
end |
Could you paste the exact error you're getting, ideally with a stack trace? |
Edit: Styling |
` ... 2022-01-26T09:01:42 [D|sql|] ↳ app/services/foreman_seeder.rb:71:in 24: from /Users/eddy/.rvm/gems/ruby-2.7.3/bin/ruby_executable_hooks:22:in eval' 23: from /Users/eddy/.rvm/gems/ruby-2.7.3/bin/sidekiq:23:in '22: from /Users/eddy/.rvm/gems/ruby-2.7.3/bin/sidekiq:23:in load' 21: from /Users/eddy/.rvm/gems/ruby-2.7.3/gems/sidekiq-5.2.9/bin/sidekiq:12:in <top (required)>'20: from /Users/eddy/.rvm/gems/ruby-2.7.3/gems/sidekiq-5.2.9/lib/sidekiq/cli.rb:46:in run' 19: from /Users/eddy/.rvm/gems/ruby-2.7.3/gems/sidekiq-5.2.9/lib/sidekiq/cli.rb:292:in boot_system'18: from /Users/eddy/.rvm/gems/ruby-2.7.3/gems/sidekiq-5.2.9/lib/sidekiq/cli.rb:292:in require' 17: from /Users/eddy/workspace/foreman-2.5.2/extras/dynflow-sidekiq.rb:29:in <top (required)>'16: from /Users/eddy/.rvm/gems/ruby-2.7.3/gems/dynflow-1.6.1/lib/dynflow/rails.rb:38:in initialize!' 15: from /Users/eddy/.rvm/gems/ruby-2.7.3/gems/dynflow-1.6.1/lib/dynflow/rails.rb:38:in tap'14: from /Users/eddy/.rvm/gems/ruby-2.7.3/gems/dynflow-1.6.1/lib/dynflow/rails.rb:41:in block in initialize!' 13: from /Users/eddy/.rvm/gems/ruby-2.7.3/gems/dynflow-1.6.1/lib/dynflow/rails/configuration.rb:132:in increase_db_pool_size'12: from /Users/eddy/.rvm/gems/ruby-2.7.3/gems/activerecord-import-1.2.0/lib/activerecord-import/import.rb:250:in establish_connection' 11: from /Users/eddy/.rvm/gems/ruby-2.7.3/gems/activerecord-6.0.3.7/lib/active_record/connection_handling.rb:51:in establish_connection'10: from /Users/eddy/.rvm/gems/ruby-2.7.3/gems/activerecord-6.0.3.7/lib/active_record/connection_adapters/abstract/connection_pool.rb:1052:in establish_connection' 9: from /Users/eddy/.rvm/gems/ruby-2.7.3/gems/activerecord-6.0.3.7/lib/active_record/connection_adapters/connection_specification.rb:169:in spec'8: from /Users/eddy/.rvm/gems/ruby-2.7.3/gems/activesupport-6.0.3.7/lib/active_support/dependencies.rb:324:in require' 7: from /Users/eddy/.rvm/gems/ruby-2.7.3/gems/activesupport-6.0.3.7/lib/active_support/dependencies.rb:291:in load_dependency'6: from /Users/eddy/.rvm/gems/ruby-2.7.3/gems/activesupport-6.0.3.7/lib/active_support/dependencies.rb:324:in block in require' 5: from /Users/eddy/.rvm/gems/ruby-2.7.3/gems/polyglot-0.3.5/lib/polyglot.rb:65:in require'4: from /Users/eddy/.rvm/gems/ruby-2.7.3/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:44:in require' 3: from /Users/eddy/.rvm/gems/ruby-2.7.3/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in require_with_bootsnap_lfi'2: from /Users/eddy/.rvm/gems/ruby-2.7.3/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/loaded_features_index.rb:89:in register' 1: from /Users/eddy/.rvm/gems/ruby-2.7.3/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in block in require_with_bootsnap_lfi'/Users/eddy/.rvm/gems/ruby-2.7.3/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in require': cannot load such file -- active_record/connection_adapters/postgres_adapter (LoadError) 25: from /Users/eddy/.rvm/gems/ruby-2.7.3/bin/ruby_executable_hooks:22:in '24: from /Users/eddy/.rvm/gems/ruby-2.7.3/bin/ruby_executable_hooks:22:in eval' 23: from /Users/eddy/.rvm/gems/ruby-2.7.3/bin/sidekiq:23:in '22: from /Users/eddy/.rvm/gems/ruby-2.7.3/bin/sidekiq:23:in load' 21: from /Users/eddy/.rvm/gems/ruby-2.7.3/gems/sidekiq-5.2.9/bin/sidekiq:12:in <top (required)>'20: from /Users/eddy/.rvm/gems/ruby-2.7.3/gems/sidekiq-5.2.9/lib/sidekiq/cli.rb:46:in run' 19: from /Users/eddy/.rvm/gems/ruby-2.7.3/gems/sidekiq-5.2.9/lib/sidekiq/cli.rb:292:in boot_system'18: from /Users/eddy/.rvm/gems/ruby-2.7.3/gems/sidekiq-5.2.9/lib/sidekiq/cli.rb:292:in require' 17: from /Users/eddy/workspace/foreman-2.5.2/extras/dynflow-sidekiq.rb:29:in <top (required)>'16: from /Users/eddy/.rvm/gems/ruby-2.7.3/gems/dynflow-1.6.1/lib/dynflow/rails.rb:38:in initialize!' 15: from /Users/eddy/.rvm/gems/ruby-2.7.3/gems/dynflow-1.6.1/lib/dynflow/rails.rb:38:in tap'14: from /Users/eddy/.rvm/gems/ruby-2.7.3/gems/dynflow-1.6.1/lib/dynflow/rails.rb:41:in block in initialize!' 13: from /Users/eddy/.rvm/gems/ruby-2.7.3/gems/dynflow-1.6.1/lib/dynflow/rails/configuration.rb:132:in increase_db_pool_size'12: from /Users/eddy/.rvm/gems/ruby-2.7.3/gems/activerecord-import-1.2.0/lib/activerecord-import/import.rb:250:in establish_connection' 11: from /Users/eddy/.rvm/gems/ruby-2.7.3/gems/activerecord-6.0.3.7/lib/active_record/connection_handling.rb:51:in establish_connection'10: from /Users/eddy/.rvm/gems/ruby-2.7.3/gems/activerecord-6.0.3.7/lib/active_record/connection_adapters/abstract/connection_pool.rb:1052:in establish_connection' 9: from /Users/eddy/.rvm/gems/ruby-2.7.3/gems/activerecord-6.0.3.7/lib/active_record/connection_adapters/connection_specification.rb:169:in spec'8: from /Users/eddy/.rvm/gems/ruby-2.7.3/gems/activesupport-6.0.3.7/lib/active_support/dependencies.rb:324:in require' 7: from /Users/eddy/.rvm/gems/ruby-2.7.3/gems/activesupport-6.0.3.7/lib/active_support/dependencies.rb:291:in load_dependency'6: from /Users/eddy/.rvm/gems/ruby-2.7.3/gems/activesupport-6.0.3.7/lib/active_support/dependencies.rb:324:in block in require' 5: from /Users/eddy/.rvm/gems/ruby-2.7.3/gems/polyglot-0.3.5/lib/polyglot.rb:65:in require'4: from /Users/eddy/.rvm/gems/ruby-2.7.3/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:44:in require' 3: from /Users/eddy/.rvm/gems/ruby-2.7.3/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in require_with_bootsnap_lfi'2: from /Users/eddy/.rvm/gems/ruby-2.7.3/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/loaded_features_index.rb:89:in register' 1: from /Users/eddy/.rvm/gems/ruby-2.7.3/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in block in require_with_bootsnap_lfi'/Users/eddy/.rvm/gems/ruby-2.7.3/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in require': Could not load the 'postgres' Active Record adapter. Ensure that the adapter is spelled correctly in config/database.yml and that you've added the necessary adapter gem to your Gemfile. (LoadError)
|
I meet this error when my database.yml has been configured to use postgresql.
The text was updated successfully, but these errors were encountered: