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. <div>
<br></div><div>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. </div>
<div><br></div><div>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". </div>
<div><br></div><div>Here's a snippet beginning at line 55:</div><div><div><br></div><div>class PostagePrinter</div><div> require "builder"</div><div> require "tempfile"</div><div> </div></div><div>
<br></div><div>Okay - I've found a difference between TM environment & command line:</div><div><br></div><div><div>The TM execution window shows "ruby 1.8.6 (2008-03-03 patchlevel 114) [universal-darwin9.0]"</div>
<div><br></div><div><div>From terminal: "ruby 1.8.6 (2007-09-24 patchlevel 111) [i686-darwin9.2.0]"</div><div><br></div><div>Suggestions on where to look to resolve the different versions of ruby that are being picked up? </div>
<div><br></div><div>Thanks!</div><div><br></div></div><div>---<br></div></div><div>David Carter<br><a href="mailto:david@carter.net">david@carter.net</a><br>
<br><br><div class="gmail_quote">On Wed, Feb 11, 2009 at 12:12 PM, James Gray <span dir="ltr"><<a href="mailto:james@grayproductions.net">james@grayproductions.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="Ih2E3d">On Feb 11, 2009, at 8:31 AM, David Carter wrote:<br>
<br>
> I'm getting this message only the first time I cmd-R a ruby script.<br>
<br>
</div>We've debated this over IRC a bit to try and think up a way this can<br>
happen. Good problem. :)<br>
<br>
About the only explanation we can think up is that the require you<br>
have is part of some conditional expression and thus doesn't always<br>
execute. Or perhaps you change the environment sometimes, before Ruby<br>
tries the require. Obviously, we're guessing.<br>
<br>
It does look like your require is a bit down in the logic though (line<br>
56 according to the stack trace). Does moving it to the top make the<br>
script fail more consistently?<br>
<br>
Also, in case our guesswork is bad, what version of TextMate are you<br>
using? Did you just happen to upgrade to the new version and did this<br>
problem just surface then?<br>
<br>
James Edward Gray II<br>
<br>
_______________________________________________<br>
textmate mailing list<br>
<a href="mailto:textmate@lists.macromates.com">textmate@lists.macromates.com</a><br>
<a href="http://lists.macromates.com/listinfo/textmate" target="_blank">http://lists.macromates.com/listinfo/textmate</a><br>
<br>
</blockquote></div><br></div>