ruby-on-railsrubyfaraday

is there a way to run two versions of the same gem within the same gem env


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?


Solution

  • 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.