1

I installed rspec and also did rspec --init. (I've gone through directions from here http://rspec.codeschool.com/levels/1 multiple times).

However, every time I try to run a spec from my command line, it won't load (please see below). Please help if you know what may be going wrong.

/Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:54:in require': cannot load such file -- zombie (LoadError) from /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:54:inrequire' from /Users/Qureshi/spec/lib/zombie_spec.rb:2:in <top (required)>' from /Library/Ruby/Gems/2.0.0/gems/rspec-core-3.2.0/lib/rspec/core/configuration.rb:1226:inload' from /Library/Ruby/Gems/2.0.0/gems/rspec-core-3.2.0/lib/rspec/core/configuration.rb:1226:in block in load_spec_files' from /Library/Ruby/Gems/2.0.0/gems/rspec-core-3.2.0/lib/rspec/core/configuration.rb:1224:ineach' from /Library/Ruby/Gems/2.0.0/gems/rspec-core-3.2.0/lib/rspec/core/configuration.rb:1224:in load_spec_files' from /Library/Ruby/Gems/2.0.0/gems/rspec-core-3.2.0/lib/rspec/core/runner.rb:97:insetup' from /Library/Ruby/Gems/2.0.0/gems/rspec-core-3.2.0/lib/rspec/core/runner.rb:85:in run' from /Library/Ruby/Gems/2.0.0/gems/rspec-core-3.2.0/lib/rspec/core/runner.rb:70:inrun' from /Library/Ruby/Gems/2.0.0/gems/rspec-core-3.2.0/lib/rspec/core/runner.rb:38:in invoke' from /Library/Ruby/Gems/2.0.0/gems/rspec-core-3.2.0/exe/rspec:4:in' from /usr/bin/rspec:23:in load' from /usr/bin/rspec:23:in'

1
  • What command are you using to run, and what folder are your rspec files? Commented Feb 22, 2015 at 18:47

2 Answers 2

1

Try putting the following at the top of your spec_helper.rb:

require_relative '../lib/zombie'

Sign up to request clarification or add additional context in comments.

Comments

1

Be sure your terminal's current folder is Users/Qureshi then run the command rspec spec

If it does not work, your file (or entire folder) is access blocked, or does not exist in /Users/Qureshi/spec/lib/

1 Comment

Thanks! For some reason (or maybe that's how it is), the rspec folder wasn't created in the same folder with the spec_helper file so I had to put those in the same folder and THEN run my command from the right folder! It finally worked.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.