Does it need two gems?

When i call:

require 'retryable' 

These two gems collide:

because they have a repetition file that they request from the user. I am interested in using the first gem, however this does not always happen.

This code runs as part of my own gem, and it should be reliable for all users.

Is there a way that is required specifically from a gemstone (since the names of the gemstones differ, of course)?

How to resolve this name conflict?

EDIT: for clarification, this is the official repo, and the gem names are actually different ("retryable-rb" and "carlo-retryable"), however they both ask their users to request the lib / retryable.rb file with require 'retryable'

+6
source share
1 answer

You can explicitly activate a specific stone using the gem method.

In this case, you need a retryable-rb stone, and not others that may have a retryable.rb file:

 gem 'retryable-rb' # activates the gem in question # and adds its lib dir to load path require 'retryable' # loads retryable.rb from the retryable-rb gem, as it # is now on the load path 
+2
source

Source: https://habr.com/ru/post/958327/


All Articles