I must be missing something because last night I was astonished to find that googling for check gem dependencies
and similar didn't reveal the answer for this.
I'm basically after a rough equivalent of rpm -V
- a command that will go through some or all my installed gems and make sure that their dependencies are also installed. Since gem install
by default installs any dependent gems, normally this is not necessary; however, if you gem uninstall
a gem and tell it to proceed with the uninstall even though other gems depend on the one being uninstalled, then obviously you will end up with broken dependencies. The question is, how do you then list those broken dependencies without installing / uninstalling / updating any gems?
N.B. answers which involve Bundler are not much use to me, since I'm still stuck on Rails 2.x for various reasons.
Since your goal is to verify a gem is installed with the correct version, use gem list . You can limit to the specific gem by using gem list data_mapper . To verify that it's installed and working, you'll have to try to require the gem and then use it in your code.
Dependencies can be downloaded when your function is deployed, or packaged locally alongside your function. Each function must provide a Gemfile that specifies the functions_framework gem, along with any additional gems needed by the function. Gemfile must be in the same directory as the app.
in the bash shell:
gem list --no-version > list
gem dependency --pipe > depends
grep -v -f list depends > failed.txt
rm list
rm depends
failed.txt will now have a list of all dependencies that are not installed.
I know you said you weren't interested in answers about Bundler, but…
Bundler will handle gem dependency resolution for you and is compatible with Rails 2.3. I've used Bundler with a number of Rails 2 apps and not had any problems with it.
There are instructions for installing Bundler on Rails 2.3 here: http://gembundler.com/rails23.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With