pre-commit-hooks
pre-commit-hooks copied to clipboard
CalledProcessError: command: ('/usr/bin/ruby', '/usr/bin/gem', 'install', '--no-document', '--no-format-executable', 'fake_gem__-0.0.0.gem')
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
The version of ruby may need to be lower than v3.
I can confirm version 3.0.0 works with ruby 3 and ubuntu 22.04 (docker image)