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

Đang mở
#798 4 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
22/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
git, ruby
Lĩnh vực
tooling

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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]

Ngôn ngữ chính
Ruby
Star
4k
Fork
288
Merge trung bình
2 ngày 4 giờ
Pull request đã merge (30 ngày)
18

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của sds/overcommit

Tất cả issue của sds/overcommit

Issue tương tự

Thêm issue về Ruby

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.