0
votes

I can't figure out why my RSPEC isn't working. I reinstalled RSPEC with sudo gem install rspec and then tried again to install with a specific version number (sudo gem install rspec -v 2.11.0)

I continue to get the following error message and I cannot figure out what it means. I believe that I may or may not have version 1 also installed, not sure.

Castillo$ rspec document_spec.rb 

/Users/Castillo/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in require': no such file to load -- document (LoadError) from /Users/Castillo/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in require' from /Users/Castillo/Desktop/document_spec.rb:1:in <top (required)>' from /Users/Castillo/.rvm/gems/ruby-1.9.2-p290/gems/rspec-core-2.11.1/lib/rspec/core/configuration.rb:780:inload' from /Users/Castillo/.rvm/gems/ruby-1.9.2-p290/gems/rspec-core-2.11.1/lib/rspec/core/configuration.rb:780:in block in load_spec_files' from /Users/Castillo/.rvm/gems/ruby-1.9.2-p290/gems/rspec-core-2.11.1/lib/rspec/core/configuration.rb:780:inmap' from /Users/Castillo/.rvm/gems/ruby-1.9.2-p290/gems/rspec-core-2.11.1/lib/rspec/core/configuration.rb:780:in load_spec_files' from /Users/Castillo/.rvm/gems/ruby-1.9.2-p290/gems/rspec-core-2.11.1/lib/rspec/core/command_line.rb:22:inrun' from /Users/Castillo/.rvm/gems/ruby-1.9.2-p290/gems/rspec-core-2.11.1/lib/rspec/core/runner.rb:69:in run' from /Users/Castillo/.rvm/gems/ruby-1.9.2-p290/gems/rspec-core-2.11.1/lib/rspec/core/runner.rb:8:in block in autorun'

1
Well, does /Users/Castillo/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb exist?Tamar
Why is it asking for that? What is that? The .rb file I'm using rspec on never requires "custom_require". The only require method I use is to require the document.rb that I am testing for which is saved on my Desktop (document_spec.rb is also saved on my Desktop.) Are you saying I should just go in there and create a blank custom_require.rb file?Smooth
@Tamar: Of course, it does exist, how else could there be an error on line 36 of it?Jörg W Mittag

1 Answers

4
votes

Add full path to your document.rb file into spec file or use require_relative or

require File.expand_path('../document.rb', __FILE__)