Skip to content

Commit

Permalink
Ensure we include the Ruby bin path (needed by JRuby)
Browse files Browse the repository at this point in the history
  • Loading branch information
bklang committed Mar 24, 2011
1 parent 3a2fc8e commit 9a52962
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/main/java/hudson/plugins/rake/RvmUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,19 @@ public static RubyInstallation[] getRvmRubies(Rvm rvm) {
ruby.setGemHome(new File(gemCandidate.toURI()).getCanonicalPath());
ruby.setGemPath(buildGemPath(ruby.getGemHome(), global, gems));

// Add RVM Ruby path
if (newpath.length() > 0) {
newpath = newpath.concat(File.pathSeparator);
}
newpath = newpath.concat(new File(ruby.getGemHome(), "bin").getCanonicalPath());
newpath = newpath.concat(rubiesPath.getRemote() + File.separator + name + File.separator + "bin");

// Add GEM bin directory to path
newpath = newpath.concat(File.pathSeparator).concat(new File(ruby.getGemHome(), "bin").getCanonicalPath());

// Create or append the calculated path for this Ruby install
path = ruby.getBinPath();
if (path == null || path.length() == 0) {
path = new String();
path = path.concat(newpath);
path = newpath;
} else {
path = path.concat(File.pathSeparator).concat(newpath);
}
Expand Down

0 comments on commit 9a52962

Please sign in to comment.