Disclaimer: I've been playing with TM for about 30 minutes, i.e. I'm a complete newcomer. One of the main reasons I'm considering abandoning my beloved emacs in favor of TM is the integrated ri / documentation lookup. But I haven't been able to get that to work.
Briefly, my question is: how can I get the TM help system to use ruby / rails documentation from a sandboxed directory?
Some details:
In my development machine I have carefully built versions of ruby 1.9.1, rails, ri, rdoc, all of my gems, etc in a sandboxed directory (~/Development/Ruby/bin/*), and I've left the Mac OS X standard distributions alone.
If I try to use TM's ^h help lookup, I get a message like:
/Applications/TextMate.app/Contents/SharedSupport/Bundles/ Ruby.tmbundle/Support/bin/linked_ri.rb:13: command not found: ri -T -f plain belongs_to
... presumably since it can't find 'ri'. Digging in, I can ask TM to tell me more about its environment:
which ri^r => /opt/local/bin/ri
ls -l /opt/local/bin/ri^r => -rwxr-xr-x 2 root admin 1491 Aug 5 2009 /opt/local/bin/ri
echo $PATH^r => /Applications/TextMate.app/Contents/SharedSupport/Support/bin/ CocoaDialog.app/Contents/MacOS:/usr/local/git/bin:/opt/local/bin:/opt/ local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/ Applications/TextMate.app/Contents/SharedSupport/Support/bin
(Another disclaimer: I'm also new to ri / rdoc, so this may ultimately be an ri / rdoc question rather than a TM question.)
- rdp
On 6/5/10 3:55 AM, Robert Poor wrote:
In my development machine I have carefully built versions of ruby 1.9.1, rails, ri, rdoc, all of my gems, etc in a sandboxed directory (~/Development/Ruby/bin/*), and I've left the Mac OS X standard distributions alone.
Try adding that directory (probably better with its real name, i.e., not using the tilde, but /Users/whatever/Development/Ruby/bin/) to your PATH variable inside TextMate's Preferences/Advanced/Shell Variables tab, in front of whatever you already have. If there is no entry yet, use whatever “echo $PATH” says inside a terminal session where your ri command works.
echo $PATH^r => /Applications/TextMate.app/Contents/SharedSupport/Support/bin/ CocoaDialog.app/Contents/MacOS:/usr/local/git/bin:/opt/local/bin:/opt/
Right. Don't forget to include the directories including /Applications/TextMate.app/ into whatever new PATH definition you set.
HTH, Christopher
Christopher Creutzig christopher@creutzig.de wrote:
On 6/5/10 3:55 AM, Robert Poor wrote:
In my development machine I have carefully built versions of ruby 1.9.1, rails, ri, rdoc, all of my gems, etc in a sandboxed directory (~/Development/Ruby/bin/*), and I've left the Mac OS X standard distributions alone.
Try adding that directory (probably better with its real name, i.e., not using the tilde, but /Users/whatever/Development/Ruby/bin/) to your PATH variable inside TextMate's Preferences/Advanced/Shell Variables tab, in front of whatever you already have. If there is no entry yet, use whatever "echo $PATH" says inside a terminal session where your ri command works.
echo $PATH^r => /Applications/TextMate.app/Contents/SharedSupport/Support/bin/ CocoaDialog.app/Contents/MacOS:/usr/local/git/bin:/opt/local/bin:/opt/
Right. Don't forget to include the directories including /Applications/TextMate.app/ into whatever new PATH definition you set.
But will this actually cause ^h to start working? On my machine, TM's ^h for Ruby has been broken for years (because it relies on fastri, which as far as I can tell is no longer supported because the ri format has changed). I just assumed it was broken for everyone. Are you saying that ^h still works for you? m.
Hi Christopher:
On 2010Jun05, at 06:10, Christopher Creutzig wrote:
On 6/5/10 3:55 AM, Robert Poor wrote:
In my development machine I have carefully built versions of ruby 1.9.1, rails, ri, rdoc, all of my gems, etc in a sandboxed directory (~/Development/Ruby/bin/*), and I've left the Mac OS X standard distributions alone.
Try adding that directory (probably better with its real name, i.e., not using the tilde, but /Users/whatever/Development/Ruby/bin/) to your PATH variable inside TextMate's Preferences/Advanced/Shell Variables tab, in front of whatever you already have. If there is no entry yet, use whatever “echo $PATH” says inside a terminal session where your ri command works.
I had already tried setting PATH, but it doesn't work either -- I think I see why. The known "good" $PATH is:
Users/r/Development/Ruby/bin:/Users/r/Development/Rails/bin:/usr/local/ mysql/bin:/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/ sbin:~/bin:/usr/local/bin:/usr/X11R6/bin
After I set PATH in the preferences/advanced/shell variables to the above string, TM shows that it has prepended some of its own directories to the PATH variable:
echo $PATH^r /Applications/TextMate.app/Contents/SharedSupport/Support/bin/ CocoaDialog.app/Contents/MacOS:/usr/local/git/bin:/opt/local/bin:/opt/ local/sbin:/Users/r/Development/Ruby/bin:/Users/r/Development/Rails/ bin:/usr/local/mysql/bin:/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/ usr/sbin:/sbin:~/bin:/usr/local/bin:/usr/X11R6/bin:/usr/X11/bin:/ Applications/TextMate.app/Contents/SharedSupport/Support/bin
I can see why -- TextMate needs to keep some of its special directories in the path. But since /opt/local/sbin now appears BEFORE /Users/r/Development/Ruby/bin, it is (I believe) finding the wrong ri. When I try ^h on a function name, I get:
/Applications/TextMate.app/Contents/SharedSupport/Support/lib/ web_preview.rb:101: warning: mismatched indentations at 'end' with 'if' at 98 ri Command Error.
... and I don't see a way to get /Users/r/Development/Ruby/bin *before* the TextMate-imposed /usr/local/sbin. (I suppose I could create relevant links /usr/local/sbin, but that would defeat the purpose of building the sandbox in the first place -- I want my own configuration, and I don't want to mess with the Apple-supplied standard version.)
Suggestions?
On 2010Jun05, at 06:10, Christopher Creutzig wrote:
On 6/5/10 3:55 AM, Robert Poor wrote:
In my development machine I have carefully built versions of ruby 1.9.1, rails, ri, rdoc, all of my gems, etc in a sandboxed directory (~/Development/Ruby/bin/*), and I've left the Mac OS X standard distributions alone.
Try adding that directory (probably better with its real name, i.e., not using the tilde, but /Users/whatever/Development/Ruby/bin/) to your PATH variable inside TextMate's Preferences/Advanced/Shell Variables tab, in front of whatever you already have. If there is no entry yet, use whatever “echo $PATH” says inside a terminal session where your ri command works.
echo $PATH^r => /Applications/TextMate.app/Contents/SharedSupport/Support/bin/ CocoaDialog.app/Contents/MacOS:/usr/local/git/bin:/opt/local/bin:/ opt/
Right. Don't forget to include the directories including /Applications/TextMate.app/ into whatever new PATH definition you set.
HTH, Christopher
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
--: Robert Poor e: robert.poor@nbt-ventures.com p: +1 617 818 5115 --: This message and the information it contains are the proprietary and confidential property of NBT Ventures and may be privileged. If you are not the intended recipient, please do not read, copy, disclose or distribute its contents to any party, and notify the sender immediately. --:
On Jun 5, 2010, at 3:23 PM, Robert Poor wrote:
echo $PATH^r /Applications/TextMate.app/Contents/SharedSupport/Support/bin/CocoaDialog.app/Contents/MacOS:/usr/local/git/bin:/opt/local/bin:/opt/local/sbin:/Users/r/Development/Ruby/bin:/Users/r/Development/Rails/bin:/usr/local/mysql/bin:/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:~/bin:/usr/local/bin:/usr/X11R6/bin:/usr/X11/bin:/Applications/TextMate.app/Contents/SharedSupport/Support/bin
I can see why -- TextMate needs to keep some of its special directories in the path. But since /opt/local/sbin now appears BEFORE /Users/r/Development/Ruby/bin, it is (I believe) finding the wrong ri.
I think your conclusion is correct here, but I wonder why /opt/local/bin and friends are being included twice? TextMate has no requirement for MacPorts, and it's not a "system" include, so I'd guess that somewhere in your configuration, it's creeping in.
Find the correct one, and I imagine things will work the way you want them.
Best, Charles
Charles:
It's a bit deeper. If I set PATH to (only):
/mypersonalpath
in Preferences => Advanced => Shell Variables, then TextMate reports:
echo $PATH /Applications/TextMate.app/Contents/SharedSupport/Support/bin/ CocoaDialog.app/Contents/MacOS:/usr/local/git/bin:/opt/local/bin:/opt/ local/sbin:/mypersonalpath:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/ bin:/usr/X11/bin:/Applications/TextMate.app/Contents/SharedSupport/ Support/bin
Note that TextMate has inserted a bunch of stuff before / mypersonalpath, specifically:
/Applications/TextMate.app/Contents/SharedSupport/Support/bin/ CocoaDialog.app/Contents/MacOS /usr/local/git/bin:/opt/local/bin /opt/local/sbin
If this IS "somewhere in my configuration", where the heck do I change it?
- Rob
On 2010Jun05, at 15:51, Charles Turner wrote:
I think your conclusion is correct here, but I wonder why /opt/local/ bin and friends are being included twice? TextMate has no requirement for MacPorts, and it's not a "system" include, so I'd guess that somewhere in your configuration, it's creeping in.
Find the correct one, and I imagine things will work the way you want them.
Best, Charles
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
On Jun 5, 2010, at 11:06 PM, Robert Poor wrote:
If this IS "somewhere in my configuration", where the heck do I change it?
I think you'll have to dope it out yourself:
http://www.semioticpixels.com/2010/01/path-settings-on-mac-snow-leopard/
HTH, Charles
On 6 Jun 2010, at 05:06, Robert Poor wrote:
[...] in Preferences => Advanced => Shell Variables, then TextMate reports:
If you are not using r1589 then please use Preferences → Software Update and switch to Cutting Edge.
In that version we no longer try to obtain PATH from users’ shell profiles. This might be the problem you are seeing.