influitive / apartment

Database multi-tenancy for Rack (and Rails) applications
2.66k stars 464 forks source link

Fresh install on Rails 7.0.4 can't setup #671

Open almaron opened 1 year ago

almaron commented 1 year ago

Steps to reproduce

Expected behavior

Actual behavior

➜  $ bundle exec rails generate apartment:install
/home/malkav/.rvm/gems/ruby-3.1.1@demiurge/gems/actionpack-7.0.4/lib/action_dispatch/middleware/stack.rb:37:in `build': undefined method `new' for "Apartment::Reloader":String (NoMethodError)

        klass.new(app, *args, &block)
             ^^^^
Did you mean?  next
    from /home/malkav/.rvm/gems/ruby-3.1.1@demiurge/gems/actionpack-7.0.4/lib/action_dispatch/middleware/stack.rb:166:in `block in build'
    from /home/malkav/.rvm/gems/ruby-3.1.1@demiurge/gems/actionpack-7.0.4/lib/action_dispatch/middleware/stack.rb:162:in `each'
    from /home/malkav/.rvm/gems/ruby-3.1.1@demiurge/gems/actionpack-7.0.4/lib/action_dispatch/middleware/stack.rb:162:in `inject'
    from /home/malkav/.rvm/gems/ruby-3.1.1@demiurge/gems/actionpack-7.0.4/lib/action_dispatch/middleware/stack.rb:162:in `build'
    from /home/malkav/.rvm/gems/ruby-3.1.1@demiurge/gems/railties-7.0.4/lib/rails/engine.rb:516:in `block in app'
    from /home/malkav/.rvm/gems/ruby-3.1.1@demiurge/gems/railties-7.0.4/lib/rails/engine.rb:512:in `synchronize'
    from /home/malkav/.rvm/gems/ruby-3.1.1@demiurge/gems/railties-7.0.4/lib/rails/engine.rb:512:in `app'
    from /home/malkav/.rvm/gems/ruby-3.1.1@demiurge/gems/railties-7.0.4/lib/rails/application/finisher.rb:52:in `block in <module:Finisher>'
    from /home/malkav/.rvm/gems/ruby-3.1.1@demiurge/gems/railties-7.0.4/lib/rails/initializable.rb:32:in `instance_exec'
    from /home/malkav/.rvm/gems/ruby-3.1.1@demiurge/gems/railties-7.0.4/lib/rails/initializable.rb:32:in `run'
    from /home/malkav/.rvm/gems/ruby-3.1.1@demiurge/gems/railties-7.0.4/lib/rails/initializable.rb:61:in `block in run_initializers'
    from /home/malkav/.rvm/rubies/ruby-3.1.1/lib/ruby/3.1.0/tsort.rb:228:in `block in tsort_each'
    from /home/malkav/.rvm/rubies/ruby-3.1.1/lib/ruby/3.1.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
    from /home/malkav/.rvm/rubies/ruby-3.1.1/lib/ruby/3.1.0/tsort.rb:431:in `each_strongly_connected_component_from'
    from /home/malkav/.rvm/rubies/ruby-3.1.1/lib/ruby/3.1.0/tsort.rb:349:in `block in each_strongly_connected_component'
    from /home/malkav/.rvm/rubies/ruby-3.1.1/lib/ruby/3.1.0/tsort.rb:347:in `each'
    from /home/malkav/.rvm/rubies/ruby-3.1.1/lib/ruby/3.1.0/tsort.rb:347:in `call'
    from /home/malkav/.rvm/rubies/ruby-3.1.1/lib/ruby/3.1.0/tsort.rb:347:in `each_strongly_connected_component'
    from /home/malkav/.rvm/rubies/ruby-3.1.1/lib/ruby/3.1.0/tsort.rb:226:in `tsort_each'
    from /home/malkav/.rvm/rubies/ruby-3.1.1/lib/ruby/3.1.0/tsort.rb:205:in `tsort_each'
    from /home/malkav/.rvm/gems/ruby-3.1.1@demiurge/gems/railties-7.0.4/lib/rails/initializable.rb:60:in `run_initializers'
    from /home/malkav/.rvm/gems/ruby-3.1.1@demiurge/gems/railties-7.0.4/lib/rails/application.rb:372:in `initialize!'
    from /home/malkav/work/demiurge/worlds/config/environment.rb:5:in `<main>'
    from /home/malkav/.rvm/gems/ruby-3.1.1@demiurge/gems/bootsnap-1.13.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
    from /home/malkav/.rvm/gems/ruby-3.1.1@demiurge/gems/bootsnap-1.13.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
    from /home/malkav/.rvm/gems/ruby-3.1.1@demiurge/gems/zeitwerk-2.6.1/lib/zeitwerk/kernel.rb:35:in `require'
    from /home/malkav/.rvm/gems/ruby-3.1.1@demiurge/gems/railties-7.0.4/lib/rails/application.rb:348:in `require_environment!'
    from /home/malkav/.rvm/gems/ruby-3.1.1@demiurge/gems/railties-7.0.4/lib/rails/command/actions.rb:28:in `require_environment!'
    from /home/malkav/.rvm/gems/ruby-3.1.1@demiurge/gems/railties-7.0.4/lib/rails/command/actions.rb:15:in `require_application_and_environment!'
    from /home/malkav/.rvm/gems/ruby-3.1.1@demiurge/gems/railties-7.0.4/lib/rails/commands/generate/generate_command.rb:21:in `perform'
    from /home/malkav/.rvm/gems/ruby-3.1.1@demiurge/gems/thor-1.2.1/lib/thor/command.rb:27:in `run'
    from /home/malkav/.rvm/gems/ruby-3.1.1@demiurge/gems/thor-1.2.1/lib/thor/invocation.rb:127:in `invoke_command'
    from /home/malkav/.rvm/gems/ruby-3.1.1@demiurge/gems/thor-1.2.1/lib/thor.rb:392:in `dispatch'
    from /home/malkav/.rvm/gems/ruby-3.1.1@demiurge/gems/railties-7.0.4/lib/rails/command/base.rb:87:in `perform'
    from /home/malkav/.rvm/gems/ruby-3.1.1@demiurge/gems/railties-7.0.4/lib/rails/command.rb:48:in `invoke'
    from /home/malkav/.rvm/gems/ruby-3.1.1@demiurge/gems/railties-7.0.4/lib/rails/commands.rb:18:in `<main>'
    from /home/malkav/.rvm/gems/ruby-3.1.1@demiurge/gems/bootsnap-1.13.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
    from /home/malkav/.rvm/gems/ruby-3.1.1@demiurge/gems/bootsnap-1.13.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
    from bin/rails:4:in `<main>'

System configuration

Ubuntu 22.04

Postgres 14.5

shutooike commented 1 year ago

@almaron Use ros-apartment. It's a fork. Refer to: https://github.com/influitive/apartment/issues/638#issuecomment-653579615

Melaku05 commented 9 months ago

Steps to reproduce

I'm new here please help

Expected behavior

To run correctly

Actual behavior

Screenshot from 2023-09-26 18-54-00

Screenshot from 2023-09-26 19-04-13

System configuration

Apartment.configure do |config|

end

Rails.application.config.middleware.use Apartment::Elevators::Host



  * `use_schemas`: (`true` or `false`)

* Rails (or ActiveRecord) version:7.0.8

* Ruby version: 3.2.2