Ankush Ganatra
Ankush Ganatra

Reputation: 510

How to Get the correct version of gem to be installed

For my code, I wanted to install the gem dependencies manually. How can I come to know the exact version required to be for the specific dependency? (Also note, I would not be accessing rubygems.org, everything is in my local)

 pack = Gem::Package.new("<.gem-file-path>")
 rd = pack.spec.runtime_dependencies

With dependency requirements being for e.g. '>= x' or different, How do I determine what is the exact version required for specific dependency?

Upvotes: 0

Views: 163

Answers (1)

chailong
chailong

Reputation: 326

Gems that, for example, ">= 1.0 " mean all versions higher or equal to 1.0 is OK to be a dependency. So gem file may not tell you the exact version, however you can use bunlder to generate the Gemfile.lock which contains all the exact-valid gems you need. In this way, all you need is some effort to parse a Gemfile.lock file.

Upvotes: 1

Related Questions