This might not be your issue. I had a really weird problem that was ungoogleable so I thought I’d post it.
With a combination of spork, guard and rspec, none of my testing stuff was working. The spork prefork block was throwing this error.
Preloading Rails environment
gsub' for nil:NilClass (NoMethodError)
The solution was to comment all my test gems one at a time. And then I realized that my Ubuntu edited version of my Gemfile was conflicting with my Mac edited version of this same file.
So I made my Gemfile a little smarter.
Then things started to work again. With any weird bugs in Rails, try commenting out gems one at a time.