Working on a tutorial and starting to use TDD/rspec.
For some reason I cannot get it to work. Been working trying to fix
this over two days now.
The tutorial has given me a Rakefile that should work. I also have a
spec file and I am creating a file to pass the tests.
I am supposed to run ‘rake’ in my console to have it return the passing
or failing tests, but each time (no matter how much I move things
around) I get the following message (as if the ‘hello.rb’ file doesn’t
exist):
in /Users//Desktop/**/learn_ruby)
/Users/*/Desktop//learn_ruby/00_hello/hello_spec.rb:116:in
`require’: cannot load such file – hello (LoadError)
around) I get the following message (as if the ‘hello.rb’ file doesn’t
exist):
in /Users//Desktop/**/learn_ruby)
/Users/*/Desktop//learn_ruby/00_hello/hello_spec.rb:116:in
`require’: cannot load such file – hello (LoadError)
You are probably not setting up the load path correctly for it to be
able to find hello.rb. If it’s in the same directory as hello_spec.rb,
you should be able to just give:
require './hello'
in hello_spec.rb; the ‘./’ says to use the current directory as the
current file. If this isn’t the case, more work will be required.
I was able to run rake and include the (so far empty) hello.rb, using
Ruby
1.9.3, which ruled out my initial theory that it required a Ruby version
from before the current directory was removed from the load path.
Yep. I tried with Ruby 2.0 and then back to 1.9.3.
My thought is that there is some older rake file (or something) that is
getting in the way. I’ve done a bunch of reading on this and trying
things out, but still no luck.
I’ve also had a friend look at it and he was able to run it on his
system.
Still pretty much a newbie, so figuring things out as I go (or in this
case, not figuring them out just yet).