views:

418

answers:

5

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.

A: 

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.

Karl Yngve Lervåg
After some research I see that this does not help. Well, at least I tried :p
Karl Yngve Lervåg
Thanks for the answer anyway! Much appreciated.
Urf
+1  A: 

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.

Greg Hewgill
Thanks Greg. Much appreciated. I haven't marked this as the correct answer as it only answers the manual part of the question. My bad for asking two questions at once!
Urf
+1  A: 

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"&gt;
<plist version="1.0">
  <dict>
    <key>CVS_RSH</key>
    <string>ssh</string>
  </dict>
</plist>
Keltia
Thanks for the info Keltia. Unfortunately I couldn't find the ~/.MacOSX/environment.plist file (no doubt due to my lack of experience). However, I will follow this up so thanks for the advice.
Urf
Keltia
Thanks, Keltia. Much appreciated.
Urf
A: 

I don't appear to have a ~/.MacOSX/environment.plist file. Should I create one? Am I being stupid? ;)

Urf
+4  A: 

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

amrox
Perfect! Worked first time. Many thanks.
Urf