jumanjihouse / pre-commit-hooks

git pre-commit hooks that work with http://pre-commit.com/
MIT License
114 stars 52 forks source link

CalledProcessError: command: ('/usr/bin/ruby', '/usr/bin/gem', 'install', '--no-document', '--no-format-executable', 'fake_gem__-0.0.0.gem') #88

Open Tronyxsystem opened 3 years ago

Tronyxsystem commented 3 years ago

Since upgrade ruby v3 I got this error when I try to do git commit/push =>

[INFO] Installing environment for https://github.com/jumanjihouse/pre-commit-hooks.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
An unexpected error has occurred: CalledProcessError: command: ('/usr/bin/ruby', '/usr/bin/gem', 'install', '--no-document', '--no-format-executable', 'fake_gem__-0.0.0.gem')
return code: 1
expected return code: 0
stdout: (none)
stderr:
    ERROR:  While executing gem ... (NoMethodError)
        undefined method `request' for nil:NilClass

My .pre-commit-config.yaml =>

---
repos:
 - repo: https://github.com/pre-commit/pre-commit-hooks
   rev: v3.4.0
   hooks:
    - id: trailing-whitespace
    - id: end-of-file-fixer
    - id: check-added-large-files
 - repo: https://github.com/jumanjihouse/pre-commit-hooks
   rev: 2.1.5
   hooks:
    - id: markdownlint
 - repo: https://github.com/adrienverge/yamllint.git
   rev: v1.26.0
   hooks:
    - id: yamllint
clownrat6 commented 3 years ago

The version of ruby may need to be lower than v3.

oNaiPs commented 1 year ago

I can confirm version 3.0.0 works with ruby 3 and ubuntu 22.04 (docker image)