After I upgraded to Lion, which has Ruby to 1.9 instead of Ruby 1.8, the command "Environment Closer – \end{…}" (⌥⌘.) in the LaTeX bundle fails with the following error:
TextMate.app/Contents/SharedSupport/Support/bin/checknest.rb:44: syntax error, unexpected ':', expecting '}' when /^-l(\d+)$/: levels = $1.to_i
I'm using TextMate 1.5.10 (1631).
Here is diff that fixes this error:
--- checknest.rb 2011-03-15 08:57:48.000000000 +0100 +++ checknest.rb 2011-12-23 10:17:00.000000000 +0100 @@ -40,11 +40,11 @@ debug = false ARGV[3..-1].each {|e| case e - when /^-n(\d+)$/: num = $1.to_i - when /^-l(\d+)$/: levels = $1.to_i - when /^-e(.+)$/: error_text = $1 - when /^-p$/: pass = true - when /^-d$/: debug = true + when /^-n(\d+)$/ then num = $1.to_i + when /^-l(\d+)$/ then levels = $1.to_i + when /^-e(.+)$/ then error_text = $1 + when /^-p$/ then pass = true + when /^-d$/ then debug = true end }
Regards, Freek Dijkstra
On 23 Dec 2011, at 09:21, Freek Dijkstra wrote:
After I upgraded to Lion, which has Ruby to 1.9 instead of Ruby 1.8,
Puzzled. I am running Lion and my version of Ruby is not 1.9.
~: ruby -v ruby 1.8.7 (2010-01-10 patchlevel 249) [universal-darwin11.0] ~: which ruby /usr/bin/ruby ~:
Dave.
<snip>
Regards, Freek Dijkstra
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
Dave Baldwin wrote:
On 23 Dec 2011, at 09:21, Freek Dijkstra wrote:
After I upgraded to Lion, which has Ruby to 1.9 instead of Ruby 1.8,
Puzzled. I am running Lion and my version of Ruby is not 1.9.
~: ruby -v ruby 1.8.7 (2010-01-10 patchlevel 249) [universal-darwin11.0] ~: which ruby /usr/bin/ruby ~:
You are correct. In my previous mail, I presumed that the shebang at top of checknest.rb was used to find the ruby version (/usr/bin/ruby). It turns out that TextMate does not use the shebang, but simply calls ruby and relies on the PATH to find the right exectable. In my case, this is /usr/local/bin/ruby, which is 1.9.3p0.
Also, I did not mention that I run a custom fork of the LaTeX bundle.
Nevertheless, this is all irrelevant, since this bug is still there in TextMate.app.
I hope the report and patch are useful enough to fix this.
Thanks, Freek
On 23 Dec 2011, at 10:21, Freek Dijkstra wrote:
After I upgraded to Lion, which has Ruby to 1.9 instead of Ruby 1.8, the command "Environment Closer – \end{…}" (⌥⌘.) in the LaTeX bundle fails with the following error:
We strongly advice against setting TextMate up to use ruby 1.9 for the bundle commands — many of them will fail.
If you need to have Ruby → Run, Validate Script, and similar use a custom ruby then set TM_RUBY to the path of your ruby 1.9 binary (rather than alter the PATH for TextMate).
Here is diff that fixes this error:
Thanks — for future reference we much prefer receiving pull requests via GitHub¹, this will also ensure commits are properly credited to the contributor.