influitive / apartment

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

Can't start rails after upgrading rails 5.2.3 to 6.0 #617

Open abigoroth opened 4 years ago

abigoroth commented 4 years ago

Steps to reproduce

  1. rails app:update
  2. manually update rails gem from 5.2.3 to 6.0 in Gemfile
  3. bundle update

Expected behavior

Supposedly rails will start as usual.

Actual behavior

/Users/ahmadyakobbinabaidullah/.asdf/installs/ruby/2.5.1/lib/ruby/gems/2.5.0/gems/actionpack-6.0.0/lib/action_dispatch/middleware/stack.rb:37:in build': undefined methodnew' for "Apartment::Reloader":String (NoMethodError) Did you mean? next

System configuration

default: &default
  adapter: postgresql
  encoding: unicode
  # For details on connection pooling, see rails configuration guide
  # http://guides.rubyonrails.org/configuring.html#database-pooling
  # pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
  pool: 220
  connect_timeout: 5
  read_timeout: 5
mkhairi commented 4 years ago

not support rails 6 yet. see https://github.com/influitive/apartment/issues/559

ekampp commented 4 years ago

@mkhairi , it says right here that there is support for < 6.1. #559 is specifically about supporting Rails 6 multi-db. This error happens when simply starting a vanilla Rails 6 app.

mkhairi commented 4 years ago

owh, no public release yet for rails 6. need to install gem from github branch development. otherwise bundler will install older version.

ekampp commented 4 years ago

@mkhairi, that is true. But it feels like this should have been caught in a test in the master branch since this happens with a vanilla rails 6 app.

The fact that @abigoroth found this problem means that he's using the master branch (or at least an unreleased branch based on it). The < 6.1 gemspec constrain in the master branch seems incorrect.

Does anyone know where a potential test that should have caught this would be located?

mkhairi commented 4 years ago

@ekampp seem like bundler install version 0.24.3 gemspec constraint on activerecord >= 3.1.2. that mean he doesn't point to any unreleased branch yet.

  • Apartment version: apartment (0.24.3)

The correct way to test with rails 6 at this moment is, install from github branch development

gem 'apartment', github: 'influitive/apartment', branch: 'development'

ekampp commented 4 years ago

@mkhairi, I checked out the dev branch, and that solves this problem.

However, the master branch does state that it supports Rails < 6.1, but in fact, it doesn't (see master branch gemspec). So that is perhaps something worth noting.

jhoynerk commented 4 years ago

Is there any idea of when there's going to be a new release (hopefully one that include support for rails 6)

domininik commented 4 years ago

Any updates from Apartment team? :)

mjfrey commented 4 years ago

Any update on a new release that supports Rails 6?

joseramonc commented 4 years ago

I can confirm my app is working as expected with development branch after upgrading to rails 6.

However, a new release that formally support rails 6 release would be very helpful.

Thanks!

ashishbista commented 4 years ago

development branch worked for me as well. A version with rails 6 support would be helpful.

dwood-somniainc commented 4 years ago

We need complete rails 6 support. Thanks!

thisismydesign commented 4 years ago

A dev answered recently in https://github.com/influitive/apartment/issues/559. There seem to be more activity here, but you should probably follow this other issue.