Whenever I open a Ruby file in TextMate 2, although it is correctly recognized, the syntax coloring and the commenting are both screwed up. Instead of command/ putting a #
at the beginning of all selected lines, I get them wrapped in /*
and */
, as though I was working in JavaScript.
I can live with the broken syntax coloring, but the commenting is driving me crazy, so I want to focus on fixing that in this question (although I won't turn down any solutions that fix both or ignore solutions to the syntax highlighting problem). I suspect they have the same root cause, so I mention the syntax highlighting in case it provides a valuable clue.
Apparently others have had a similar problem with commenting CSS in TextMate (2) mentioned in "Textmate "comment" command not working properly for css code", but the fixes there didn't help me. There's "TextMate toggle comment macro is broken" as well, but that has very different symptoms.
TextMate was using my system Ruby (2.0.0 on OS X 10.10), in case that's relevant, but I switched it to using 2.2.3 through rbenv and the problem remains.