Comment bundle in TextMate 2 produces errors

0

I'm very fond of TextMate's "Comment Line/Selection" bundle, which lets me use ⌘-/ to comment or un-comment highlighted lines. Recently, however, when I use that key combination, I get this error:

Comment Line / Selection:16:in `require': no such file to load -- /lib/escape (LoadError)

The bundle is in Ruby, and the line of code in question is a require:

require "#{ENV["TM_SUPPORT_PATH"]}/lib/escape"

I don't see TM_SUPPORT_PATH defined in my preferences, and I can't find a file named escape on my Mac.

This is TextMate 2.0-alpha.9419. It's possible that a recent update broke this bundle, but I can't quite pin it down. Ideas for how to restore this function would be very welcome!

pjmorse

Posted 2013-05-21T15:55:31.447

Reputation: 305

Answers

3

If env ruby is Ruby 2.0 or 1.9, try either:

  • Editing PATH or TM_RUBY in Preferences > Variables.
  • Changing #!/usr/bin/env ruby to #!/usr/bin/ruby Source > Menu Actions > Comments > Comment Line / Selection.

Or try temporarily deleting bundles. From [TxMt] TM2 error running Comment Line/Selection - Google Groups:

Your bundles are likely messed up.

The TM_SUPPORT_PATH comes from the Bundle Support bundle, so you may have uninstalled that.

You can check Preferences → Bundles or remove ~/Library/Application Support/{TextMate,Avian}/ and relaunch to get back to defaults.

TM_SUPPORT_PATH is something like ~/Library/Application Support/TextMate/Managed/Bundles/Bundle Support.tmbundle/Support/shared. Try running echo $TM_SUPPORT_PATH or env with ⌃R.

Lri

Posted 2013-05-21T15:55:31.447

Reputation: 34 501

1Uninstalling and reinstalling the "Bundle Support" bundle did the trick. (Uninstalling and reinstalling "Source", which provides the actual shortcut, didn't.) I wouldn't have tried that one without this pointer, thanks! – pjmorse – 2013-05-21T18:27:51.450