While working on some tests, I started getting the following error for all tests.
Psych::SyntaxError: couldn't parse YAML at line 92 column 0
Using this code to run tests:
ruby -Itest ./test/functional/users_controller_test.rb
I couldn’t find any YAML errors in the fixtures, so I undid all my changes. According to git, the files are in the same state as when I started. But I keep getting the same error.
How to fix? How to find the file that is causing the problem?
Rails 3.0.7
Ruby 1.9.2p290
Found it! There was a tab character in two fixtures files.
The strange thing is that the files did not change from before. They used to work fine. I am sure of that because git can tell the difference between a tab and a space. (The files are now modified).
Apparently a gem or some other file got updated with a YAML parser that is more picky…but the strange thing is that I did not update anything.
I guess this is a good reason to run RVM or rbenv (which I am). Too bad it doesn’t explain what happened…