Don't pass --user-install if ruby is managed by rbenv (fix #393) (#489)

This commit is contained in:
Roey Darwish Dror
2020-08-01 15:13:04 +03:00
committed by GitHub
parent d2bab85a86
commit 43be5bd7da

View File

@@ -50,7 +50,15 @@ pub fn run_gem(base_dirs: &BaseDirs, run_type: RunType) -> Result<()> {
print_separator("RubyGems");
run_type.execute(&gem).args(&["update", "--user-install"]).check_run()
let mut command = run_type.execute(&gem);
command.arg("update");
if env::var_os("RBENV_SHELL").is_none() {
debug!("Detected rbenv. Avoiding --user-install");
command.arg("--user-install");
}
command.check_run()
}
pub fn run_sheldon(ctx: &ExecutionContext) -> Result<()> {