Summary
Hi there!
The markdownlint hook fails to run with prek but works with pre-commit.
I get this error message:
/home/mariusz/.cache/prek/hooks/ruby-bZ78BhS89Bkcqt4t5dzs/gems/bin/mdl: line 6: /home/mariusz/.cache/prek/hooks/ruby-bZ78BhS89Bkcqt4t5dzs/gems/bin/ruby: No such file or directory
That mdl script looks like this:
#!/bin/sh
# -*- ruby -*-
_=_\
=begin
bindir="${0%/*}"
exec "$bindir/ruby" "-x" "$0" "$@"
=end
#!/home/mariusz/.cache/prek/tools/ruby/3.3.0/bin/ruby
#
# This file was generated by RubyGems.
#
# The application 'mdl' is installed as part of a gem, and
# this file is here to facilitate running it.
#
...
Clearly it needs to use the ruby executable found at ~/.cache/prek/tools/ruby/3.3.0/bin/ruby, which does exist, but to do that it tries to use another ruby executable which does not.
I'm not familiar with any of this so that's all I have for you. Let me know if there is anything else I can provide to help.
Willing to submit a PR?
Platform
Linux 6.19.13-zen1-1-zen x86_64 GNU/Linux
Version
prek 0.3.10 (1981c51 2026-04-21)
.pre-commit-config.yaml
---
repos:
- repo: https://github.com/markdownlint/markdownlint
rev: v0.15.0
hooks:
- id: markdownlint
Log file
2026-04-26T23:28:35.428021Z DEBUG prek: 0.3.10 (1981c51f5 2026-04-21)
2026-04-26T23:28:35.428048Z DEBUG Args: ["prek", "--all-files"]
2026-04-26T23:28:35.429046Z TRACE get_root: close time.busy=973µs time.idle=2.99µs
2026-04-26T23:28:35.429067Z DEBUG Git root: /home/mariusz/projects/dstamp_1
2026-04-26T23:28:35.429078Z DEBUG Found workspace root at `/home/mariusz/projects/dstamp_1`
2026-04-26T23:28:35.429082Z TRACE Include selectors: ``
2026-04-26T23:28:35.429084Z TRACE Skip selectors: ``
2026-04-26T23:28:35.429122Z DEBUG discover{root="/home/mariusz/projects/dstamp_1" config=None refresh=false}: Loaded workspace from cache
2026-04-26T23:28:35.429134Z DEBUG discover{root="/home/mariusz/projects/dstamp_1" config=None refresh=false}: Loading project configuration path=.pre-commit-config.yaml
2026-04-26T23:28:35.429220Z TRACE discover{root="/home/mariusz/projects/dstamp_1" config=None refresh=false}: close time.busy=126µs time.idle=1.17µs
2026-04-26T23:28:35.429372Z TRACE Checking lock resource="store" path=/home/mariusz/.cache/prek/.lock
2026-04-26T23:28:35.429388Z DEBUG Acquired lock resource="store"
2026-04-26T23:28:35.430013Z DEBUG Hooks going to run: ["markdownlint"]
2026-04-26T23:28:35.430267Z TRACE Executing `/home/mariusz/.cache/prek/tools/ruby/3.3.0/bin/ruby -e puts RUBY_VERSION`
2026-04-26T23:28:35.475851Z DEBUG Found installed environment for hook `markdownlint` at `/home/mariusz/.cache/prek/hooks/ruby-bZ78BhS89Bkcqt4t5dzs`
2026-04-26T23:28:35.475911Z TRACE Released lock path=/home/mariusz/.cache/prek/.lock
2026-04-26T23:28:35.475943Z TRACE collect_files:ls_files{cwd="/home/mariusz/projects/dstamp_1" path="/home/mariusz/projects/dstamp_1"}: Executing `cd /home/mariusz/projects/dstamp_1 && /usr/sbin/git ls-files -z -- /home/mariusz/projects/dstamp_1`
2026-04-26T23:28:35.476991Z TRACE collect_files:ls_files{cwd="/home/mariusz/projects/dstamp_1" path="/home/mariusz/projects/dstamp_1"}: close time.busy=207µs time.idle=848µs
2026-04-26T23:28:35.477011Z DEBUG collect_files: All files in the workspace: 35
2026-04-26T23:28:35.477020Z TRACE collect_files: close time.busy=248µs time.idle=846µs
2026-04-26T23:28:35.477096Z TRACE for_project{project=.}: close time.busy=5.49µs time.idle=549ns
2026-04-26T23:28:35.477104Z TRACE Files for project `.` after filtered: 35
2026-04-26T23:28:35.477112Z TRACE get_diff{path="/home/mariusz/projects/dstamp_1"}: Executing `/usr/sbin/git diff -- /home/mariusz/projects/dstamp_1`
2026-04-26T23:28:35.478270Z TRACE get_diff{path="/home/mariusz/projects/dstamp_1"}: close time.busy=113µs time.idle=1.05ms
2026-04-26T23:28:35.478291Z DEBUG Running priority group with priority 0 with concurrency 8: ["markdownlint"]
2026-04-26T23:28:35.478599Z TRACE for_hook{hook="markdownlint"}: close time.busy=299µs time.idle=834ns
2026-04-26T23:28:35.478617Z TRACE Files for hook `markdownlint` after filtered: 2
2026-04-26T23:28:35.478730Z TRACE run{hook_id=markdownlint language=ruby}: Resolved command: /home/mariusz/.cache/prek/hooks/ruby-bZ78BhS89Bkcqt4t5dzs/gems/bin/mdl
2026-04-26T23:28:35.478753Z TRACE run{hook_id=markdownlint language=ruby}: Found shebang: ["/bin/sh"]
2026-04-26T23:28:35.478771Z TRACE run{hook_id=markdownlint language=ruby}: Resolved interpreter: /bin/sh
2026-04-26T23:28:35.478807Z TRACE run{hook_id=markdownlint language=ruby}: Running markdownlint total_files=2 concurrency=8
2026-04-26T23:28:35.478869Z TRACE run{hook_id=markdownlint language=ruby}: Executing `cd /home/mariusz/projects/dstamp_1 && /bin/sh /home/mariusz/.cache/prek/hooks/ruby-bZ78BhS89Bkcqt4t5dzs/gems/bin/mdl README.md CONTRIBUTING.md`
2026-04-26T23:28:35.500108Z TRACE run{hook_id=markdownlint language=ruby}: close time.busy=464µs time.idle=21.0ms
2026-04-26T23:28:35.500152Z TRACE get_diff{path="/home/mariusz/projects/dstamp_1"}: Executing `/usr/sbin/git diff -- /home/mariusz/projects/dstamp_1`
2026-04-26T23:28:35.501583Z TRACE get_diff{path="/home/mariusz/projects/dstamp_1"}: close time.busy=223µs time.idle=1.21ms
Summary
Hi there!
The markdownlint hook fails to run with prek but works with pre-commit.
I get this error message:
That
mdlscript looks like this:Clearly it needs to use the ruby executable found at
~/.cache/prek/tools/ruby/3.3.0/bin/ruby, which does exist, but to do that it tries to use another ruby executable which does not.I'm not familiar with any of this so that's all I have for you. Let me know if there is anything else I can provide to help.
Willing to submit a PR?
Platform
Linux 6.19.13-zen1-1-zen x86_64 GNU/Linux
Version
prek 0.3.10 (1981c51 2026-04-21)
.pre-commit-config.yaml
Log file