You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When running bin/setup on the current main, it breaks when attempting to drop the databasse.
Things to consider
Here are the details:
undefined local variable or method establish_master_connection’ for #<ActiveRecord::Tasks::PostgreSQLDatabaseTasks:0x000000011e9e2450 @db_config=#<ActiveRecord::DatabaseConfigurations::HashConfig:0x000000011d9028b0 @env_name=“development”, @name=“primary”, @configuration_hash={:adapter=>“postgresql”, :encoding=>“unicode”, :host=>nil, :database=>“diaper_dev”, :username=>nil, :password=>nil, :pool=>5, :timeout=>5000}>, @configuration_hash={:adapter=>“postgresql”, :encoding=>“unicode”, :host=>nil, :database=>“diaper_dev”, :username=>nil, :password=>nil, :pool=>5, :timeout=>5000}> Couldn’t drop database ‘diaper_dev’ bin/rails aborted! NameError: undefined local variable or method establish_master_connection’ for #<ActiveRecord::Tasks::PostgreSQLDatabaseTasks:0x000000011e9e2450 @db_config=#<ActiveRecord::DatabaseConfigurations::HashConfig:0x000000011d9028b0 @env_name=“development”, @name=“primary”, @configuration_hash={:adapter=>“postgresql”, :encoding=>“unicode”, :host=>nil, :database=>“diaper_dev”, :username=>nil, :password=>nil, :pool=>5, :timeout=>5000}>, @configuration_hash={:adapter=>“postgresql”, :encoding=>“unicode”, :host=>nil, :database=>“diaper_dev”, :username=>nil, :password=>nil, :pool=>5, :timeout=>5000}> (NameError)
establish_master_connection
^^^^^^^^^^^^^^^^^^^^^^^^^^^
Did you mean? establish_connection
/Users/clfisher/projects/human-essentials/config/initializers/postgres.rb:7:in `drop’
Tasks: TOP => db:drop:_unsafe
(See full trace by running task with --trace)
== Command [“bin/rails db:reset”] failed ==“(edited)
IIUC , we are overriding ActiveRecord::Tasks::PostgreSQLDatabaseTasks.drop in config/initializers/postgres.rb in development and test.
Our override calls establish_master_connection.
This https://apidock.com/rails/v7.1.3.2/ActiveRecord/Tasks/PostgreSQLDatabaseTasks seems to suggest that establish_master_connection is no longer a thing. It lists a newish method: establish_connection which one might surmise is a replacement.
Criteria for Completion
bin/setup works again!
The text was updated successfully, but these errors were encountered:
FYI Apparently it is/was "A zero-config Rack server for Mac OS X. It is a self-contained server that runs as a user without root privileges."
The reposotiry for it (basecamp/pow) was archived in 2020. (https://github.com/basecamp/pow)
I too, expect we've moved on, and that this overriding could be yanked.
Summary
When running bin/setup on the current main, it breaks when attempting to drop the databasse.
Things to consider
Here are the details:
undefined local variable or method
establish_master_connection’ for #<ActiveRecord::Tasks::PostgreSQLDatabaseTasks:0x000000011e9e2450 @db_config=#<ActiveRecord::DatabaseConfigurations::HashConfig:0x000000011d9028b0 @env_name=“development”, @name=“primary”, @configuration_hash={:adapter=>“postgresql”, :encoding=>“unicode”, :host=>nil, :database=>“diaper_dev”, :username=>nil, :password=>nil, :pool=>5, :timeout=>5000}>, @configuration_hash={:adapter=>“postgresql”, :encoding=>“unicode”, :host=>nil, :database=>“diaper_dev”, :username=>nil, :password=>nil, :pool=>5, :timeout=>5000}> Couldn’t drop database ‘diaper_dev’ bin/rails aborted! NameError: undefined local variable or method
establish_master_connection’ for #<ActiveRecord::Tasks::PostgreSQLDatabaseTasks:0x000000011e9e2450 @db_config=#<ActiveRecord::DatabaseConfigurations::HashConfig:0x000000011d9028b0 @env_name=“development”, @name=“primary”, @configuration_hash={:adapter=>“postgresql”, :encoding=>“unicode”, :host=>nil, :database=>“diaper_dev”, :username=>nil, :password=>nil, :pool=>5, :timeout=>5000}>, @configuration_hash={:adapter=>“postgresql”, :encoding=>“unicode”, :host=>nil, :database=>“diaper_dev”, :username=>nil, :password=>nil, :pool=>5, :timeout=>5000}> (NameError)establish_master_connection
^^^^^^^^^^^^^^^^^^^^^^^^^^^
Did you mean? establish_connection
/Users/clfisher/projects/human-essentials/config/initializers/postgres.rb:7:in `drop’
Tasks: TOP => db:drop:_unsafe
(See full trace by running task with --trace)
== Command [“bin/rails db:reset”] failed ==“(edited)
IIUC , we are overriding ActiveRecord::Tasks::PostgreSQLDatabaseTasks.drop in config/initializers/postgres.rb in development and test.
Our override calls establish_master_connection.
This https://apidock.com/rails/v7.1.3.2/ActiveRecord/Tasks/PostgreSQLDatabaseTasks seems to suggest that establish_master_connection is no longer a thing. It lists a newish method: establish_connection which one might surmise is a replacement.
Criteria for Completion
The text was updated successfully, but these errors were encountered: