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)
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.
And let me say: Good for you!
···
On Tue, Apr 30, 2013 at 2:15 AM, Tom Galpin <lists@ruby-forum.com> wrote:
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)
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.
···
On Tue, Apr 30, 2013 at 2:20 PM, Tom Galpin <lists@ruby-forum.com> wrote:
Thanks for the response.
Still didn't work. Tried to play around with all kinds of maneuvers on
the require path. But the same issues.
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.