adrianno.86
adrianno.86

Reputation: 11

Cannot load such file - Ruby gkms plugin

I'm trying to use gmks plugin for encrypting files for one of my projects. But whatever I do, I end up with this error:

/Library/Ruby/Site/2.6.0/rubygems/core_ext/kernel_require.rb:85:in `require': cannot load such file -- hiera/backend/eyaml/encryptors/gkms (LoadError)
    from /Library/Ruby/Site/2.6.0/rubygems/core_ext/kernel_require.rb:85:in `require'
    from /Users/user/.gem/ruby/2.6.0/gems/hiera-eyaml-3.4.0/lib/hiera/backend/eyaml/encryptor.rb:17:in `find'
    from /Users/user/.gem/ruby/2.6.0/gems/hiera-eyaml-3.4.0/lib/hiera/backend/eyaml/subcommands/encrypt.rb:79:in `execute'
    from /Users/user/.gem/ruby/2.6.0/gems/hiera-eyaml-3.4.0/lib/hiera/backend/eyaml/CLI.rb:46:in `execute'
    from /Users/user/.gem/ruby/2.6.0/gems/hiera-eyaml-3.4.0/bin/eyaml:21:in `<top (required)>'
    from /Users/user/.gem/ruby/2.6.0/bin/eyaml:25:in `load'
    from /Users/user/.gem/ruby/2.6.0/bin/eyaml:25:in `<main>'

Now I've tried to reinstall the plugin, along with hiera-eyaml even Ruby..

❯ eyaml version
[hiera-eyaml-core] hiera-eyaml (core): 3.4.0
❯ ruby -v
ruby 3.3.0 (2023-12-25 revision 5124f9ac75) [arm64-darwin22]

I have everything added to $PATH.

The gems are available in the gem lib

❯ gem list

*** LOCAL GEMS ***

abbrev (default: 0.1.2)
addressable (2.8.6)
...
getoptlong (default: 0.2.1)
google-cloud-core (1.6.1)
google-cloud-env (2.1.0)
google-cloud-errors (1.3.1)
google-cloud-kms (2.0.0)
google-cloud-kms-v1 (0.24.1)
google-cloud-location (0.7.0)
google-iam-v1 (0.7.1)
google-protobuf (3.25.2)
googleapis-common-protos (1.4.0)
googleapis-common-protos-types (1.11.0)
googleauth (1.9.1)
grpc (1.60.0)
grpc-google-iam-v1 (1.5.0)
hiera-eyaml (3.4.0)
hiera-eyaml-gkms (0.2.0)
highline (3.0.0)
io-console (default: 0.7.1)
io-nonblock (default: 0.3.0)
...

To sumarize what I did:

Reinstalled the gems (also tried different versions i.e. hiera-eyaml-gkms-0.2.40). Updated the local gem library (gem update --system). Reinstalled Ruby Updated $PATH

++ Also maybe worth mentioning: working on a Apple M1 Pro

EDIT:

the $PATH on my computer:

export PATH="/opt/homebrew/opt/ruby/bin:/opt/homebrew/lib/ruby/gems/3.1.0/bin:$PATH" 

$LOAD_PATH shows

irb(main):001> puts $LOAD_PATH
/opt/homebrew/lib/ruby/site_ruby/3.3.0
/opt/homebrew/lib/ruby/site_ruby/3.3.0/arm64-darwin22
/opt/homebrew/lib/ruby/site_ruby
/opt/homebrew/lib/ruby/vendor_ruby/3.3.0
/opt/homebrew/lib/ruby/vendor_ruby/3.3.0/arm64-darwin22
/opt/homebrew/lib/ruby/vendor_ruby
/opt/homebrew/Cellar/ruby/3.3.0/lib/ruby/3.3.0
/opt/homebrew/Cellar/ruby/3.3.0/lib/ruby/3.3.0/arm64-darwin22

Upvotes: 0

Views: 114

Answers (1)

adrianno.86
adrianno.86

Reputation: 11

I managed to find the issue. There was a version mismatch in the $PATH variable.

Upvotes: 1

Related Questions