Sorry for not mentioning the TM version. This behavior existed as originally described before the upgrade to the newest version [Version 1.5.8 (1498)] this morning. After I sent the previous message, I upgraded & now the problem occurs every time, not just the first time. At least it's more consistent now. This script has been in almost daily use for over a year, with no recent changes. I always run it from within TM since I've been too lazy to add proper parameter handling to the script. I just launch it in TM, comment in or out a line or two at the very bottom that controls what gets done, and hit cmd-R.
The require is at line 56 because the script includes several embedded classes in the same file. Poor form, I know, but it was one of those, "I'll get around to it later" things that I've never gotten around to because "it just worked".
Here's a snippet beginning at line 55:
class PostagePrinter require "builder" require "tempfile"
Okay - I've found a difference between TM environment & command line:
The TM execution window shows "ruby 1.8.6 (2008-03-03 patchlevel 114) [universal-darwin9.0]"
From terminal: "ruby 1.8.6 (2007-09-24 patchlevel 111) [i686-darwin9.2.0]"
Suggestions on where to look to resolve the different versions of ruby that are being picked up?
Thanks!
--- David Carter david@carter.net
On Wed, Feb 11, 2009 at 12:12 PM, James Gray james@grayproductions.netwrote:
On Feb 11, 2009, at 8:31 AM, David Carter wrote:
I'm getting this message only the first time I cmd-R a ruby script.
We've debated this over IRC a bit to try and think up a way this can happen. Good problem. :)
About the only explanation we can think up is that the require you have is part of some conditional expression and thus doesn't always execute. Or perhaps you change the environment sometimes, before Ruby tries the require. Obviously, we're guessing.
It does look like your require is a bit down in the logic though (line 56 according to the stack trace). Does moving it to the top make the script fail more consistently?
Also, in case our guesswork is bad, what version of TextMate are you using? Did you just happen to upgrade to the new version and did this problem just surface then?
James Edward Gray II
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate