jumanjihouse / pre-commit-hooks

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

Error in pre-commit run [ERROR: Error installing fake_gem__-0.0.0.gem:] #116

Closed kaveri-lolge closed 9 months ago

kaveri-lolge commented 9 months ago

Hello Team,

I'm trying to run pre-commit run -a which fails with below error:

[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: ('/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby', '/usr/bin/gem', 'install', '--no-document', '--no-format-executable', '--no-user-install', '--install-dir', '/Users/kaveri.lolge/.cache/pre-commit/repod4b_9tky/rbenv-system/gems', '--bindir', '/Users/kaveri.lolge/.cache/pre-commit/repod4b_9tky/rbenv-system/gems/bin', 'fake_gem__-0.0.0.gem')
return code: 1
stdout:
    Successfully installed unicode-display_width-1.4.1
    Successfully installed ruby-progressbar-1.13.0
    Successfully installed rainbow-3.1.1
    Successfully installed powerpack-0.1.3
    Successfully installed ast-2.4.2
    Successfully installed parser-2.5.3.0
    Successfully installed parallel-1.23.0
    Building native extensions. This could take a while...
stderr:
    ERROR:  Error installing fake_gem__-0.0.0.gem:
        ERROR: Failed to build gem native extension.

Could you please help me fix this issue?

Thanks

kaveri-lolge commented 9 months ago

Hello @jumanjiman , could you please help me here? I'm blocked because of this.

nniehoff commented 9 months ago

This appears to be a duplicate of #88

kaveri-lolge commented 9 months ago

Hey @nniehoff , could you please explain how this appears to be duplicate of mentioned issue??

My Ruby version is ruby 2.6.10p210 (2022-04-12 revision 67958) [universal.arm64e-darwin22] which hasn't upgraded to v3.

My .pre-commit-config.yaml =>

python: python3
repos:
  - repo: https://github.com/pre-commit/pre-commit-hooks
    rev: v2.5.0
    hooks:
      - id: trailing-whitespace
      - id: end-of-file-fixer
      - id: check-added-large-files
      - id: check-merge-conflict
      - id: detect-private-key
      - id: mixed-line-ending
      - id: check-yaml
  - repo: https://github.com/adrienverge/yamllint
    rev: v1.23.0
    hooks:
      - id: yamllint  # Configured in yamllint-config.yml
        name: Check yaml files with yamllint
        entry: yamllint -c yamllint-config.yml
        language: python
        additional_dependencies: ['yamllint']
        types: [yaml]
  - repo: https://github.com/Lucas-C/pre-commit-hooks
    rev: v1.1.7
    hooks:
      - id: forbid-tabs
  - repo: https://github.com/jumanjihouse/pre-commit-hooks
    rev: 2.0.2
    hooks:
      - id: markdownlint  # Configured in .mdlrc
kaveri-lolge commented 9 months ago

This was fixed after I upgrade the ruby version to ruby 2.7.8p225