-
Notifications
You must be signed in to change notification settings - Fork 118
Description
I just answered this question on StackOverflow about how to configure OSX Mountain Lion (not tested on earlier versions) to modify the internal PATH variable used by applications that are not opened from the command line, and I figured I'd share it with you so you could put it in the README, removing one limitation of your plugin :)
-
Make sure you have admin privileges.
-
Open Terminal or your favorite substitute and see if there's anything in the file
/etc/launchd.conf:cat /etc/launchd.confIf you get an error like
cat: /etc/launchd.conf: No such file or directory
then continue with the next step. If the
catcommand does display some content, copy it to the clipboard. -
Create a new text file (
⌘ N)with the following content, modified to fit your needs:setenv PATH /usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin:/Users/YourUserName/bin:/path/to/gems/binIf the
catcommand displayed some content in the previous step, paste it into the new file before thesetenv PATHcommand. If it already contains asetenv PATHcommand, just modify it to add the directories you need, such as/path/to/gems/bin -
Save the new file in your home directory (
/Users/YourUserName) aslaunchd.conf. -
Go back to Terminal and enter:
sudo mv ~/launchd.conf /etcto use admin power to move the new file to
/etc, replacing anything that was there before. You'll need to enter your password at this point. -
_Reboot your computer_
And you should be all set. This has only been tested on Mountain Lion (OSX 10.8), so you'll need to test it first if you're running an earlier version.
I hope this is helpful, it really was to me when I discovered it a few months back. If you need anything else, just let me know.
Matt