|
From: <caw...@us...> - 2007-08-14 17:27:27
|
Revision: 2974
http://rubyeclipse.svn.sourceforge.net/rubyeclipse/?rev=2974&view=rev
Author: cawilliams
Date: 2007-08-14 10:27:26 -0700 (Tue, 14 Aug 2007)
Log Message:
-----------
hack to set up a base PATH environment when launchign ruby process on non-Win32 platforms. We need this to install gems that need to be compiled, as otehrwise it'll complain of missing ruby headers and missing make. This won't cover every case, certainly, but shoudl cover the most common ones (everything needed is in /usr/bin, /usr/local/bin, and parent of ruby executable).
Modified Paths:
--------------
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/StandardVMRunner.java
Modified: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/StandardVMRunner.java
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/StandardVMRunner.java 2007-08-14 17:25:57 UTC (rev 2973)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/StandardVMRunner.java 2007-08-14 17:27:26 UTC (rev 2974)
@@ -243,7 +243,24 @@
String[] cmdLine= new String[arguments.size()];
arguments.toArray(cmdLine);
- String[] envp= config.getEnvironment();
+ String[] env2;
+ String[] envp= config.getEnvironment();
+ if (!Platform.getOS().equals(Platform.OS_WIN32)) { // if not on windows, hack to add a basic PATH
+ File exe = StandardVMType.findRubyExecutable (fVMInstance
+ .getInstallLocation());
+ String env = "PATH=" + exe.getParent() + File.pathSeparator
+ + "/usr/local/bin" + File.pathSeparator + "/usr/bin" + File.pathSeparator + "PATH";
+
+ if (envp != null) {
+ env2 = new String[envp.length];
+ System.arraycopy(envp, 0, env2, 0, envp.length);
+ env2[ envp.length] = env;
+ } else {
+ env2 = new String[] { env };
+ }
+ } else {
+ env2 = envp;
+ }
subMonitor.worked(1);
@@ -255,7 +272,7 @@
subMonitor.subTask(LaunchingMessages.StandardVMRunner_Starting_virtual_machine____3);
Process p= null;
File workingDir = getWorkingDir(config);
- p= exec(cmdLine, workingDir, envp);
+ p= exec(cmdLine, workingDir, env2);
if (p == null) {
return;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|