0

In my Gemfile I need gem lumberg and gem openai_chatgpt which both depend on gem faraday. However, lumberg depends on faraday pre v 2.0 and openai_chatgpt depends on faraday post v 2.0. Faraday 2.0+ was a significant change.

The result is that the bundler cannot resolve the dependencies.

Is there a work around for this conundrum?

willyab
  • 167
  • 1
  • 10
  • Maybe could downgrade one? https://stackoverflow.com/questions/8878980/rails-bundle-one-gem-two-versions?rq=2 – rogerdpack Aug 17 '23 at 04:50

2 Answers2

2

There is no way to load two different versions of the same gem at the same time in Ruby.

The latest version of the lumberg gem is more than 6 years old, I would consider it unmaintained, and I am surprised that it still works with current versions of Ruby.

I suggest forking that gem and fix the dependency to work with a newer version of faraday gem.

spickermann
  • 100,941
  • 9
  • 101
  • 131
1

There is alternative solution but its bit time taken, process is here.

  1. Just clone the older version of gem.
  2. Make the small changes to make it supportable with you current version on ruby and rails, just like upgrading the dependencies.
  3. push the gem on your github account with slightly different.
  4. Then mention the new gem in Gemfile with repository path.
  5. Bundle install.

Hope fully it will resolve your issue.

Create Explorer
  • 357
  • 2
  • 20