How do I fix a Mac OSX Profile call to missing /usr/local/bin directory?

0

1

Somehow, possibly in-between installing RVM and MacPorts, I get an error message whenever I open up my terminal in Snow Leopard that complains that I have an invalid identifier in my bash export. I've tracked down the culprit to be /usr/local/bin which doesn't seem to exist on my system. Should this worry me? and if not, how do I find out where /usr/local/bin is being called from?

I've looked in .profile, .bashrc, and .bash_profile in my home directory, but I can't seem to find it in any of those files. Where else could it be, or how can I easily find out?

Thanks, Rich

purpletonic

Posted 2010-02-14T12:31:28.233

Reputation: 572

I found the culprit... turns out it was nothing to do with /usr/local/bin, as mipadi said. Instead, there was a line in .bash_profile, which was causing the issue: PATH=$PATH:~/.gem/ruby/1.8/bin ; export $PATH; So I changed this to export PATH=$PATH:~/.gem/ruby/1.8/bin and the issue went away. Please comment if this is likely to cause any errors in the future. Rich – purpletonic – 2010-02-15T21:30:01.947

Answers

1

Are you sure the culprit is the placement of /usr/local/bin? When Bash complains of an invalid identifier, it's complaining about the name of an exported variable, not the variable's contents (Bash does't care about the contents).

As for .profile, .bash_profile, and .bashrc, if they're not in your home directory, you can just create them.

mipadi

Posted 2010-02-14T12:31:28.233

Reputation: 3 980

Thanks for pointing me in the right direction, see my comment for the final solution I settled on. – purpletonic – 2010-02-15T21:30:52.333

2

Have you taken a look at the file /etc/paths and the files inside the folder /etc/paths.d for mention of /usr/local/bin? Those files are used by the path_helper utility that is invoked from /etc/profile to set up different paths for different applications when creating an environment for the logged in user.

ayaz

Posted 2010-02-14T12:31:28.233

Reputation: 8 106

Thanks Ayaz, there's a mention of it in /etc/paths. Should I remove this? – purpletonic – 2010-02-15T20:05:05.667

1

The directory /usr/local/bin, doesn't exist on a clean install of Mac OS X (or it doesn't contain anything).

So you don't have to worry about this.

Try ayaz method and it it doesn't work, try looking in /etc/profile or /etc/bashrc to see if there are any references to /usr/local/bin.

Studer

Posted 2010-02-14T12:31:28.233

Reputation: 3 448

Should I remove the mention of /usr/local/bin from /etc/paths or simply create the bin folder? What binary files would go in here anyway? – purpletonic – 2010-02-15T20:05:47.693