I'm getting this message only the first time I cmd-R a ruby script.
*LoadError:* no such file to load — builder
method gem_original_requiretxmt://open?line=27&url=file:///System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/custom_require.rb in *custom_require.rb* at line 27method requiretxmt://open?line=27&url=file:///System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/custom_require.rb in *custom_require.rb* at line 27*at top level*txmt://open?line=56&url=file:///Users/david/scripts/getAndaleSales.rb in *getAndaleSales.rb* at line 56
If I cmd-R a second time, the script runs normally. If I restart TM, I get the same failure again on first run, works on second run.
I followed the troubleshooting instructions & removed a local copy of the Ruby bundle that I had downloaded previously via svn.
Thanks for any suggestions.
--- David Carter david@carter.net
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
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
On Feb 11, 2009, at 9:35 AM, David Carter wrote:
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?
In Terminal, do “which ruby” and copy that path. Go to TextMate's shell vars in preferences and set TM_RUBY=«path to shell ruby». Do you still have the error?
—Alex
On Feb 11, 2009, at 11:35 AM, David Carter wrote:
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?
Sure. See this:
http://wiki.macromates.com/Troubleshooting/RubyVersionIssue
James Edward Gray II