2
votes

I'm pretty green at all this and am working my way through Michael Hartl's Ruby on Rails Tutorial. I've just started diving into the Sample_App in chapter 3 and just "lost" all syntax highlighting for all files that I'm working on in Sublime Text 2 for Windows.

Syntax highlighting had been working previously, and upon opening the first file of this section in Sublime Text 2, I received the following error message:

Error loading syntax file "Packages/User/RSpec.tmLanguage": Error parsing plist xml: Failed to open file In file "Packages/User/RSpec.tmLanguage"

Now all syntax highlighting has vanished completely.

I ran some searches, and tried adding this "syntax_highlighting.py" file to my Packages/User directory, but I'm still receiving the same error and still without any syntax highlighting.

Any help steering me in the right direction would be most appreciated! Thanks.

3

3 Answers

1
votes

I have rectified this problem. The RSPec.tmLanguage file needed to be moved from Packages/rails_tutorial_sublime_text to Packages/User. Once that was done, I reactivated my color scheme from the Sublime Text 2 "Preferences" menu.

Sometimes the answers are hidden in plain sight, and I actually wouldn't have figured this out without @MattYork, so thanks!

1
votes

It looks like the RSpec.tmLanguage is not a valid language file that ST recognizes. If you delete that, you will likely get syntax highlighting back.

1
votes

I just fixed this error for me as well. If someone is still having issues, here's what I did:

Open ~/Library/Application Support/Sublime Text 2/Packages/User/syntax_highlighting.py and remove User/ from these lines

if name[-8:] == "_spec.rb":
  set_syntax(view, "Rspec", "User/RSpec")
elif name == "factories.rb":
  set_syntax(view, "Rspec", "User/RSpec")

Restart Sublime couple of times.