0

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

Charles
  • 50,943
  • 13
  • 104
  • 142
B Seven
  • 44,484
  • 66
  • 240
  • 385
  • I don't think it is one in the test/fixtures directory. I loaded some of them in the console, and they load fine. I think it is some kind of configuration setting...but I don't think anything changed. The test file does run with Spork. – B Seven Aug 16 '12 at 05:32

2 Answers2

1

Upgrade your Rails to a newer 3.0.x version, and look at this other Stack Overflow question for other hints.

Community
  • 1
  • 1
smathy
  • 26,283
  • 5
  • 48
  • 68
0

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...

B Seven
  • 44,484
  • 66
  • 240
  • 385