influitive / apartment

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

Error when trying to generate apartment initializer #682

Open krlosgilson opened 8 months ago

krlosgilson commented 8 months ago

Steps to reproduce

Added gem 'apartment' to Gemfile [ok] Run: bundle install [ok] Run: bundle exec rails generate apartment:install [fail]

Expected behavior

Generate apartment initializer file

Actual behavior

Error ocorred: /home/carlos/.rvm/gems/ruby-3.2.1/gems/actionpack-7.0.4.2/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

System configuration

abhishek-fullstackror commented 2 months ago

I encountered the same issue and resolved it by replacing the apartment gem with the ros-apartment gem. The updated Gemfile entry is as follows: gem 'ros-apartment', require: 'apartment' refences: link