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

オープン
#798 コメント 4 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
22/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
git, ruby
領域
tooling

調査の方向性

The failure comes from Bundler resolving the Gemfile when git hooks run, so start with the Gemfile and the code that invokes Bundler during hook execution. Reproduce it by running an overcommit command without bundle exec in an environment where bundle info cadence-ruby finds the gem, then compare against the bundle exec run that works. Done means the hook runs from a plain git commit without the 'Could not find gem' error, which is hard to confirm without the reporter's Ruby 2.7 and RVM setup.

索引モデルが issue の本文から書いたものです。

説明

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]

主要言語
Ruby
スター
4k
フォーク
288
平均マージ
2日 4時間
マージ済み PR(30日)
18

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

sds/overcommit のほかの issue

sds/overcommit の issue をすべて見る

似ている issue

Ruby の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。