Question

I recently installed the Macports port of Ruby19 and it's changed my environment settings to point to opt/local in the first instance rather than usr/local where I have my standard 1.8.7 install.

I've tried updating my ~/.profile by adding the usual export PATH etc. as the last line but to no avail. I have to run the .profile file each time I open a new terminal window/tab and it's fast becoming a royal pita.

I'm fairly noob to OS X so can anyone point me in the right direction, please?

Is there a way to edit the environment.plist directly? Is there a better way to do this? As a side topic (if such things are allowed), can anyone recommend some good resources for learning more about the inner workings of OS X?

Thanks in advance.

Was it helpful?

Solution

bash on Mac OS X prefers '.bash_profile' instead of '.profile'. Try that.

OTHER TIPS

The Missing Manual series is pretty good. I got one for OS X and refer to it when I need to do something that I know should be easy, but don't know how to do.

It depends on when you want this setting to take place. If at the very beginning of your session, the place to put it is in ~/.MacOSX/environment.plist. That way, it will be available everywhere whether you are in a shell or not.

EDIT: add example

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
  <dict>
    <key>CVS_RSH</key>
    <string>ssh</string>
  </dict>
</plist>

I have never owned a Mac, but I am familiar with Linux. Since both are Unix, I guess there might be similarities. Try to add the usual 'export PATH' to '~/.bashrc' instead of '~/.profile'. This works on Linux, anyway.

Edit: It seems like there are some differences between OS X and Linux. My advice does not seem to help solve the problem. Anyway, see here for a short description of each initialization script.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top