Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions ruby-runner.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ insert_env_path(const char *envname, const char *paths, size_t size, int prepend
setenv(envname, env, 1);
}

#define insert_env_path_lit(env, path, prep) \
insert_env_path(env, path, sizeof(path), prep)

#define EXTOUT_DIR BUILDDIR"/"EXTOUT
int
main(int argc, char **argv)
Expand All @@ -81,6 +84,10 @@ main(int argc, char **argv)
insert_env_path(LIBPATHENV, builddir, dirsize, 1);
insert_env_path("RUBYLIB", rubylib, sizeof(rubylib), 0);

insert_env_path_lit("GEM_PATH", ABS_SRCDIR"/.bundle", 1);
insert_env_path_lit("GEM_PATH", BUILDDIR"/.bundle", 1);
if (!getenv("GEM_HOME")) setenv("GEM_HOME", ABS_SRCDIR"/.bundle", 1);

if (!(p = strrchr(arg0, '/'))) p = arg0; else p++;
if (strlen(p) < namesize - 1) {
argv[0] = malloc(p - arg0 + namesize);
Expand Down
2 changes: 1 addition & 1 deletion test/ruby/test_process.rb
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ def test_overwrite_ENV
end;
end

MANDATORY_ENVS = %w[RUBYLIB RJIT_SEARCH_BUILD_DIR]
MANDATORY_ENVS = %w[RUBYLIB GEM_HOME GEM_PATH RJIT_SEARCH_BUILD_DIR]
case RbConfig::CONFIG['target_os']
when /linux/
MANDATORY_ENVS << 'LD_PRELOAD'
Expand Down
Loading