# Rspec/rake note working

**URL:** <https://rubytalk.org/t/rspec-rake-note-working/67788>\
**Category:** ruby-talk\
**Created:** [30 April 2013 07:15 UTC](https://rubytalk.org/t/rspec-rake-note-working/67788 "2013-04-30T07:15:19Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![7stud2](https://avatars.discourse-cdn.com/v4/letter/7/9de053/32.png) [@7stud2](https://rubytalk.org/u/7stud2)\
**Post date:** [30 April 2013 07:15 UTC](https://rubytalk.org/t/rspec-rake-note-working/67788/1 "2013-04-30T07:15:19Z")

</div>

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)

> **···**
>
> --  
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).

---

<div class="post-metadata">

**Author:** ![Tamara\_Temple1](https://avatars.discourse-cdn.com/v4/letter/t/5f9b8f/32.png) [@Tamara\_Temple1](https://rubytalk.org/u/Tamara_Temple1)\
**Post date:** [30 April 2013 17:39 UTC](https://rubytalk.org/t/rspec-rake-note-working/67788/2 "2013-04-30T17:39:58Z")

</div>

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:

&nbsp;&nbsp;&nbsp;&nbsp;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)

---

<div class="post-metadata">

**Author:** ![7stud2](https://avatars.discourse-cdn.com/v4/letter/7/9de053/32.png) [@7stud2](https://rubytalk.org/u/7stud2)\
**Post date:** [30 April 2013 19:20 UTC](https://rubytalk.org/t/rspec-rake-note-working/67788/3 "2013-04-30T19:20:13Z")

</div>

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.

> **···**
>
> --  
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).

---

<div class="post-metadata">

**Author:** ![Eric\_Christopherson](https://yyz1.discourse-cdn.com/flex029/user_avatar/rubytalk.org/eric_christopherson/32/1849_2.png) [@Eric\_Christopherson](https://rubytalk.org/u/Eric_Christopherson)\
**Post date:** [30 April 2013 21:14 UTC](https://rubytalk.org/t/rspec-rake-note-working/67788/4 "2013-04-30T21:14:31Z")

</div>

Note: the tutorial Tom's working with comes from \<  
[http://testfirst.org/learn\_ruby&gt;\](http://testfirst.org/learn_ruby&gt;%5C).

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.
> > 
> > --  
> > Posted via [http://www.ruby-forum.com/\](http://www.ruby-forum.com/%5C).

---

<div class="post-metadata">

**Author:** ![7stud2](https://avatars.discourse-cdn.com/v4/letter/7/9de053/32.png) [@7stud2](https://rubytalk.org/u/7stud2)\
**Post date:** [30 April 2013 21:25 UTC](https://rubytalk.org/t/rspec-rake-note-working/67788/5 "2013-04-30T21:25:13Z")

</div>

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.

> **···**
>
> --  
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).

---

<div class="post-metadata">

**Author:** ![7stud2](https://avatars.discourse-cdn.com/v4/letter/7/9de053/32.png) [@7stud2](https://rubytalk.org/u/7stud2)\
**Post date:** [1 May 2013 01:19 UTC](https://rubytalk.org/t/rspec-rake-note-working/67788/6 "2013-05-01T01:19:13Z")

</div>

I just figured it out. Thanks for you help. I appreciate it. After  
three days of bashing my head against the wall.

The problem: I had a space in the name of a folder in the path to my  
file. I took out the space, and voila!

Lesson learned: never name anything with a space again!

> **···**
>
> --  
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).
