Search code examples
rubyrubygems

Ruby gem list google-auth lists the gem but gem which google-auth can't find the file


According to Google Gemini the gem googleauth is deprecated due to OOB security issues and the code has been transferred to the gem google-auth. I am using ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [x86_64-linux-gnu].

Running gem list google-auth returns google-auth (0.0.2) but gem which google-auth returns Can't find Ruby library file or shared library google-auth.

When I run gem env, I get

- /var/lib/gems/2.7.0
- /home/markhorrocks/.gem/ruby/2.7.0
- /usr/lib/ruby/gems/2.7.0
- /usr/share/rubygems-integration/2.7.0
- /usr/share/rubygems-integration/all
- /usr/lib/x86_64-linux-gnu/rubygems-integration/2.7.0

Checking these directories :-

/var/lib/gems/2.7.0/gems contains the required file google-auth-0.0.2

/usr/lib/ruby/gems/2.7.0/gems does not contain the file

/usr/share/rubygems-integration/2.7.0 does not exist

/usr/share/rubygems-integration/all/gems does not contain the file.

/usr/lib/x86_64-linux-gnu/rubygems-integration/2.7.0 does not exist

Why does the gem path not give the subdirectory gems and why is gem which google-auth not finding the gem listed in /var/lib/gems/2.7.0/gems?

This minimal test script

#! /usr/bin/ruby
require 'google/auth'
puts Google::Auth::VERSION

returns 'require': cannot load such file -- google/auth (LoadError).

How can I fix this?


Solution

  • Google Gemini is clearly hallucinating.

    The google-auth gem is obviously not the successor of the googleauth gem, because there is only one version available, and that version was released more than 12 years ago.

    The googleauth is still under active development, and the latest version was released just a couple of weeks ago.

    In the documentation of the googleauth gem is indeed mentioned that the Google Auth OOB flow has been discontinued on January 31, 2023. Because the OOB flow is a legacy flow that is no longer considered secure.

    But that doesn't mean that there is a need to use another gem, but to continue using Google Auth, you are only required to migrate to another, more secure flow. For more information on how to do this, please refer to this OOB Migration guide.

    Google provides a document explaining if you are affected and what options you have and how to migrate.