Is that any ways to run pg_jobs gem in rails 7?

41 Views Asked by At

We are using pg_jobs gem for our rails 5 application but now we are trying to upgrade our application with rails 7 ...In that place, we are facing some issues like can't able to bundle the pg_jobs in rails 7 because it's supports the rails 5 only so can't able to run bundle install.

we tried to change the version of pg_jobs gem then also same error we are facing.

This is the error :

**Bundler could not find compatible versions for gem "rails":
  In Gemfile:
    rails (~> 7.0.4)

    pg_jobs was resolved to 0.1.0, which depends on
      rails (< 6.0, >= 5.1)```
**



1

There are 1 best solutions below

0
spickermann On

The latest version of the pg_jobs gem (as of today) does not even support Ruby on Rails >= 6.0 yet (see Rubygems).

I would consider this gem being abandoned, taking into account that:

  • only one version of the gem was released ever
  • the gem does not support any up-to-date Rails version anymore and
  • the gem's source code didn't get any update in the last 3 years

That means your options are very limited, because it seems unreasonable to expect any updates from the gem's maintainer anymore. And downgrading your application is also not an option because then you were locked to an unsupported Ruby on Rails version.

The only two options I see are:

  1. Fork the gem and update it to Ruby on Rails 7.0 on your own.
  2. Switch to another ActiveJob worker implementation, like Sidekiq.

Forking and taking over maintenance feels like a burden, given that the gem doesn't seem to provide something very special or unique. Therefore, I suggest switching to another gem. Sidekiq is certainly the most popular nowadays, but there are other alternatives like Resque or DelayedJob (see Background Jobs on the Ruby Toolbox) that are worth it being considered depending on your requirements.