Rspec 'cannot load such file'

zombie.rb should be located in {project_home}/lib/ as pointed out by @kclowes.

In your case since it lives in the same folder (not recommended), you should use the format: require './zombie' and not require 'zombie' because the latter is used for standard and/or third party libraries.

This question is months old but I am answering in case somebody stumbles upon this problem.


In addition to kclowes answer you can add directories to your autoload paths within the rails configuration so that they're automatically required when Rails loads.

To do this simply add

config.autoload_paths << "#{config.root}/spec/lib"

to config/test.rb


Typically you don't want your zombie.rb inside your spec folder since it's not a test file, but I'm not familiar with the Code School tutorials. RSpec does some magic with file paths so it might be looking in the wrong spot.

You might try either require_relative "./zombie" or move zombie.rb outside of your spec file and require "<path_to_zombie>/zombie".