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. ` Using RSpec Preloading Rails environment undefined method 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.

group :test do
  gem 'rspec'
  gem 'rspec-rails'
  gem 'spork'
  gem 'rb-inotify' if RUBY_PLATFORM.downcase.include?("linux")
  gem 'rb-fsevent' if RUBY_PLATFORM.downcase.include?("darwin")
  gem 'guard'
  gem 'guard-rspec'
  gem 'guard-spork'

Then things started to work again. With any weird bugs in Rails, try commenting out gems one at a time.