Skip to content

Commit a3e3b3d

Browse files
committed
fix for rbenv used outside of pre-commit and language_version: default
1 parent 59acc7e commit a3e3b3d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

pre_commit/languages/ruby.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ def get_env_patch(
5252
else: # pragma: win32 no cover
5353
patches += (
5454
('RBENV_ROOT', venv),
55-
('RBENV_VERSION', language_version),
5655
(
5756
'PATH', (
5857
os.path.join(venv, 'gems', 'bin'), os.pathsep,
@@ -61,6 +60,9 @@ def get_env_patch(
6160
),
6261
),
6362
)
63+
if language_version not in {'system', 'default'}: # pragma: win32 no cover
64+
patches += (('RBENV_VERSION', language_version),)
65+
6466
return patches
6567

6668

0 commit comments

Comments
 (0)