![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
So I was trying to run some Ruby scripts from within BBEdit, and was getting nothing but guff -- it was running the wrong version of Ruby, refusing to look in my $PATH for required libraries, and barfing every time I even mentioned gems. I was having some problems in the Terminal, too, but an update/recompile of Ruby and rubygems made those go away. No such luck in BBEdit.
Eventually, I figured out that BB was basically pretending that my .profile file didn't exist... but only when using the shebang menu to run a script; shell worksheets were perfectly well-behaved.
The answer turned out to be that GUI apps get their environment variables from somewhere else entirely. I followed the instructions, making a plist with the appropriate $RUBYOPT and $PATH variables, and hey presto, victory!
(This post is dedicated to my sister, because I haven't posted anything incomprehensible and technical for, like, months, and she still gives me guff about it. I figure, if I'm gonna do the time anyhow...)
EDIT: So, you know the trick where you can add on to your path variable by saying, for example, export PATH=/opt/local/bin:/opt/local/sbin:~/bin:$PATH? Well, that doesn't work in environment.plist -- whatever system is reading the file can't expand the $PATH part of the trick, so you have to actually spell out every directory you want on your path. I discovered this when BBEdit learned about the /opt/local directories just fine, but forgot about /usr/bin.
It still knew /bin, though, which strikes me as odd -- apparently it's inheriting something from somewhere, but what it inherits is something other than the default value for $PATH. MYSTERY.
Also, remember that you have to log out and log back in for changes in environment.plist to take effect.
Eventually, I figured out that BB was basically pretending that my .profile file didn't exist... but only when using the shebang menu to run a script; shell worksheets were perfectly well-behaved.
The answer turned out to be that GUI apps get their environment variables from somewhere else entirely. I followed the instructions, making a plist with the appropriate $RUBYOPT and $PATH variables, and hey presto, victory!
(This post is dedicated to my sister, because I haven't posted anything incomprehensible and technical for, like, months, and she still gives me guff about it. I figure, if I'm gonna do the time anyhow...)
EDIT: So, you know the trick where you can add on to your path variable by saying, for example, export PATH=/opt/local/bin:/opt/local/sbin:~/bin:$PATH? Well, that doesn't work in environment.plist -- whatever system is reading the file can't expand the $PATH part of the trick, so you have to actually spell out every directory you want on your path. I discovered this when BBEdit learned about the /opt/local directories just fine, but forgot about /usr/bin.
It still knew /bin, though, which strikes me as odd -- apparently it's inheriting something from somewhere, but what it inherits is something other than the default value for $PATH. MYSTERY.
Also, remember that you have to log out and log back in for changes in environment.plist to take effect.