Skip to content

"Could not find gem '...' in locally installed gems" Upon Running Overcommit #798

Open

Description

@jeffsaremi

None of overcommit commands run. They all produce this error:

Resolving dependencies........
Could not find gem 'cadence-ruby' in locally installed gems
Run `bundle install` to install missing gems.

However:

❯ bundle info cadence-ruby
  * cadence-ruby (0.1.15)
        Summary: Cadence Ruby client
        Homepage: https://github.com/coinbase/cadence-ruby
        Path: /Users/jeffsaremi/.rvm/gems/ruby-2.7.6/gems/cadence-ruby-0.1.15

Manually installing gem install cadence-ruby -v 0.1.15 does not help

However running overcommit commands (eg overcommit --run) with a bundle exec works. eg:
bundle exec overcommit --run

But still none of the git hooks run :

❯ git commit -am "removing dummy changes"
Problem loading 'Gemfile': Could not find gem 'cadence-ruby' in locally installed gems
Try running:
bundle install --gemfile=Gemfile
❯ bundle version
Bundler version 2.2.20 (2021-06-11 commit 4c510a34a4)

❯ ruby -v
ruby 2.7.6p219 (2022-04-12 revision c9c2245c0a) [x86_64-darwin21]

Activity

  1. alfuken commented on Nov 17, 2022

    @alfuken

    not really a fix but a clutch: try installing both gems into MacOS default system ruby

  2. jeffsaremi commented on Nov 17, 2022

    @jeffsaremi
    Author

    Thanks Bodhan! I will try this and get back to you

  3. jeffsaremi commented on Nov 17, 2022

    @jeffsaremi
    Author

    I did this which still made no difference:

    ❯ sudo gem install --no-user-install cadence-ruby -v 0.1.15
    Password:
    Fetching thrift-0.17.0.gem
    Fetching oj-3.13.23.gem
    Fetching cadence-ruby-0.1.15.gem
    Building native extensions. This could take a while...
    GemWrappers: Can not wrap not executable file: codeowners
    Successfully installed oj-3.13.23
    Building native extensions. This could take a while...
    GemWrappers: Can not wrap not executable file: codeowners
    Successfully installed thrift-0.17.0
    GemWrappers: Can not wrap not executable file: codeowners
    Successfully installed cadence-ruby-0.1.15
    Parsing documentation for oj-3.13.23
    Installing ri documentation for oj-3.13.23
    Parsing documentation for thrift-0.17.0
    Installing ri documentation for thrift-0.17.0
    Parsing documentation for cadence-ruby-0.1.15
    Installing ri documentation for cadence-ruby-0.1.15
    Done installing documentation for oj, thrift, cadence-ruby after 4 seconds
    3 gems installed
    
    ❯ sudo gem install --no-user-install bundler
    Fetching bundler-2.3.26.gem
    GemWrappers: Can not wrap not executable file: codeowners
    Successfully installed bundler-2.3.26
    Parsing documentation for bundler-2.3.26
    Installing ri documentation for bundler-2.3.26
    Done installing documentation for bundler after 0 seconds
    1 gem installed
    
    ❯ overcommit --run
    Resolving dependencies.........
    Could not find gem 'cadence-ruby' in locally installed gems
    Run `bundle install` to install missing gems.
    
    
  4. ZhaoSongGOO commented on Mar 10, 2025

    @ZhaoSongGOO

    The issue I'm facing here is that I use rbenv to manage two Ruby versions locally: 2.6.10 and 2.7.8. When I use version 2.7.8, I encounter the problem described above. My final solution was to delete the contents of /Library/Ruby. I noticed that this directory contains Ruby gems for version 2.6, which might have caused caching conflicts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions