Skip to content

R.app path and environment variables

4 messages · Gad Abraham, Byron Ellis, Simon Urbanek

#
Hi,

Where does R.app, when launched from the Dock, get its environment
variables from, including PATH?

I've tried setting the PATH in ~/.bash_profile and /etc/paths, but when
launched from the Dock, it doesn't get through:
/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin

If I start R.app from Terminal using
/Applications/R.app/Contents/MacOS/R, it does show up:
/usr/bin:/bin:/usr/sbin:/sbin:/sw/bin:/usr/local/bin:/sw/sbin:/usr/X11/bin:/usr/local/git/bin/:/usr/local/bin

I'm using R 2.7.1 on Leopard 10.5.4.

Thanks,
Gad
#
The Window Manager in OS X does not execute as you nor does it spawn a  
shell to start a process so your bash profile is never called. There  
are ways to change the environment variables through editing the  
OSXEnvironment plist...


On Aug 9, 2008, at 5:13 AM, Gad Abraham <gabraham at csse.unimelb.edu.au>  
wrote:
#
Byron Ellis wrote:
Thanks Byron, that did the job.

I created a file ~/.MacOSX/environment.plist containing:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" 
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>PATH</key>
<string>/usr/bin:/bin:/usr/sbin:/sbin:/sw/bin:/usr/local/bin:/sw/sbin:/usr/X11/bin:/usr/local/git/bin/</string>
</dict>
</plist>

Now R can see the full path when launched from the dock.

Cheers,
Gad
#
On Aug 9, 2008, at 6:13 AM, Gad Abraham wrote:

            
From the launchd process (or LS in general, details depend on the  
version of OS X you use).
That is as expected since launchd doesn't read those. You can use  
Environment.plist for processes started by LS, see
http://developer.apple.com/qa/qa2001/qa1067.html

Cheers,
Simon