# Vanilla Rails 2.1 and Unit Test Error

**URL:** <https://discuss.rubyonrails.org/t/vanilla-rails-2-1-and-unit-test-error/30192>\
**Category:** rubyonrails-talk\
**Created:** [June 3, 2008, 10:52pm UTC](https://discuss.rubyonrails.org/t/vanilla-rails-2-1-and-unit-test-error/30192 "2008-06-03T22:52:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Derek\_P](https://avatars.discourse-cdn.com/v4/letter/d/ba9def/32.png) [@Derek\_P](https://discuss.rubyonrails.org/u/Derek_P)\
**Post date:** [June 3, 2008, 10:52pm UTC](https://discuss.rubyonrails.org/t/vanilla-rails-2-1-and-unit-test-error/30192/1 "2008-06-03T22:52:56Z")

</div>

I did a basic rails 2.1 command and made a basic model and ran the unit tests with rake, I get this error:

LoadError: no such file to load — test\_helper

I went back and compared my old unit tests from other projects to the one that was generated, this is what I found:

RAILS 2.1: require 'test\_helper'

RAILS 2.0.2: require File.dirname(\_\_FILE\_\_) + '/../test\_helper'

Now, if I copy/paste my old rails 2.0.2 require statement, it works perfectly. Did this get overlooked?

---

<div class="post-metadata">

**Author:** ![redconfetti](https://avatars.discourse-cdn.com/v4/letter/r/50afbb/32.png) [@redconfetti](https://discuss.rubyonrails.org/u/redconfetti)\
**Post date:** [June 15, 2008, 5:23pm UTC](https://discuss.rubyonrails.org/t/vanilla-rails-2-1-and-unit-test-error/30192/2 "2008-06-15T17:23:20Z")

</div>

I'm learning from this book to currently and got snagged on the test chapter because of this same error - [Pragmatic Bookshelf: By Developers, For Developers](http://www.pragprog.com/titles/ndphpr/rails-for-php-developers)

It has me run a test directly like 'ruby test/unit/meeting\_test.rb . I just changed the require at the top from:

require 'test\_helper'

to:

require 'test/test\_helper'

I don't know if this will help you when running from rake though, but it worked for me. Perhaps this is a mistake with 2.1.0. I'm don't know. I'm a noob.
