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

未關閉
#798 4 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

還沒有人認領這個 Issue。

評估

難度
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 小時
30 天內合併 PR
18

環境準備

  • 沒有 Dockerfile 或 Docker Compose 檔案
  • 沒有 Pull Request 範本
  • 閱讀貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

sds/overcommit 的其他 Issue

查看 sds/overcommit 的全部 Issue

相似的 Issue

更多 Ruby Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。