Open zainzafar opened 5 years ago
Seems to be a duplicate of https://github.com/thiagopradi/octopus/issues/489
@zainzafar did you figure this out? I have the same issue ...
@knagode nop.. I stuck to Rails 5.1.x for now. Rails 6 has native support for multiple databases.
@zainzafar After I added (config/puma.rb
) ...
on_worker_boot do
ActiveRecord::Base.establish_connection
ActiveRecord::Base.connection.initialize_shards(Octopus.config
end
Octopus started working but I only can use it on dynos - I still have issues on worker dynos or rails console.
@zainzafar how do you use octopus in gemfile? gem 'ar-octopus'
? Or do you load specific version? Which?
I did gem ar-octopus
and made sure that I had the latest version in Gemfile.lock
HI @zainzafar,
I haven't used Octopus + Puma yet. I'll try to reproduce your error locally to see if I can fix it.
Thiago
Thanks @thiagopradi. This is the only gem that's preventing us to upgrade to Rails 5.2. Would love a fix to this.
@thiagopradi looks like there is a number of issues opened related to this; any chance you could help?
Any update on this @thiagopradi?
@zainzafar - did you have any luck with this?
Still running into issues with this. Tried using the branch from master as well as kevinjcoleman's branch, but having no luck. Anyone else figure this out?
gem 'ar-octopus', git: 'https://github.com/kevinjcoleman/octopus.git', branch: 'feature/updating-octopus-versions'
We're using Puma and Rails 5.2.8.1
Don't want to speak too soon, but I might have fixed it with this:
on_worker_boot do
if defined?(ActiveRecord::Base)
ActiveRecord::Base.establish_connection
ActiveRecord::Base.connection.initialize_shards(Octopus.config) if Octopus.enabled?
end
end
Can you upgrade your rails to version 7?
My environment: Rails 5.2.0 Octopus: 0.10.1 Puma 3.12.0