Skip to content

Commit

Permalink
Merge pull request #2905 from jaysoffian/fix-gem-install
Browse files Browse the repository at this point in the history
Force gem installation into envdir
  • Loading branch information
asottile committed Jun 13, 2023
2 parents f073f8e + 50b1511 commit e891f86
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pre_commit/languages/ruby.py
Expand Up @@ -114,6 +114,8 @@ def _install_ruby(
def install_environment(
prefix: Prefix, version: str, additional_dependencies: Sequence[str],
) -> None:
envdir = lang_base.environment_dir(prefix, ENVIRONMENT_DIR, version)

if version != 'system': # pragma: win32 no cover
_install_rbenv(prefix, version)
with in_env(prefix, version):
Expand All @@ -135,6 +137,8 @@ def install_environment(
'gem', 'install',
'--no-document', '--no-format-executable',
'--no-user-install',
'--install-dir', os.path.join(envdir, 'gems'),
'--bindir', os.path.join(envdir, 'gems', 'bin'),
*prefix.star('.gem'), *additional_dependencies,
),
)

0 comments on commit e891f86

Please sign in to comment.