# "No such file to load" error when running Rspec

**URL:** <https://www.ruby-forum.com/t/no-such-file-to-load-error-when-running-rspec/157082>\
**Category:** Rails\
**Created:** [January 7, 2009, 8:13am UTC](https://www.ruby-forum.com/t/no-such-file-to-load-error-when-running-rspec/157082 "2009-01-07T08:13:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![eeby](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/ecb155/32.png) [@eeby](https://www.ruby-forum.com/u/eeby)\
**Post date:** [January 7, 2009, 8:13am UTC](https://www.ruby-forum.com/t/no-such-file-to-load-error-when-running-rspec/157082/1 "2009-01-07T08:13:49Z")

</div>

Mac OS 10.4  
rspec (1.1.11, 1.1.4, 1.1.3, 0.5.15)  
rspec-rails (1.1.11)  
rspec\_generator (0.5.15)  
rails 2.2.2  
ruby 1.8.6 (2007-03-13 patchlevel 0) [universal-darwin8.0]

Created a new project…

```
$ rails myproject

```

Installed rspec into the project…

```
$ script/generate rspec

```

Generated a resource…

```
$ script/generate rspec_scaffold myresource name:string

```

description:text

Tried to run specs…

```
$ rake spec

```

Got this error:

```
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in

```

`gem_original_require': no such file to load -- ./spec/models/../../ vendor/generators/rspec/lib/rspec_on_rails (MissingSourceFile) from /usr/local/lib/ruby/site_ruby/1.8/rubygems/ custom_require.rb:31:in`require’  
from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.2.2/  
lib/active\_support/dependencies.rb:155:in `require' from ./spec/models/../spec_helper.rb:3 from ./spec/models/entry_spec.rb:1:in`require’  
from ./spec/models/entry\_spec.rb:1  
from /usr/local/lib/ruby/gems/1.8/gems/rspec-1.1.11/lib/  
spec/runner/example\_group\_runner.rb:14:in `load' from /usr/local/lib/ruby/gems/1.8/gems/rspec-1.1.11/lib/ spec/runner/example_group_runner.rb:14:in`load\_files’  
from /usr/local/lib/ruby/gems/1.8/gems/rspec-1.1.11/lib/  
spec/runner/example\_group\_runner.rb:13:in `each' from /usr/local/lib/ruby/gems/1.8/gems/rspec-1.1.11/lib/ spec/runner/example_group_runner.rb:13:in`load\_files’  
from /usr/local/lib/ruby/gems/1.8/gems/rspec-1.1.11/lib/  
spec/runner/options.rb:98:in `run_examples' from /usr/local/lib/ruby/gems/1.8/gems/rspec-1.1.11/lib/ spec/runner/command_line.rb:10:in`run’  
from /usr/local/lib/ruby/gems/1.8/gems/rspec-1.1.11/bin/  
spec:4  
/usr/local/lib/ruby/site\_ruby/1.8/rubygems/custom\_require.rb:31:in  
`gem_original_require': no such file to load -- /Users/ethan/project/ project/spec/../vendor/generators/rspec/lib/rspec_on_rails (MissingSourceFile) from /usr/local/lib/ruby/site_ruby/1.8/rubygems/ custom_require.rb:31:in`require’  
from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.2.2/  
lib/active\_support/dependencies.rb:155:in `require' from /Users/ethan/project/project/spec/spec_helper.rb:3 from ./spec/controllers/entries_controller_spec.rb: 1:in`require’  
from ./spec/controllers/entries\_controller\_spec.rb:1  
from /usr/local/lib/ruby/gems/1.8/gems/rspec-1.1.11/lib/  
spec/runner/example\_group\_runner.rb:14:in `load' from /usr/local/lib/ruby/gems/1.8/gems/rspec-1.1.11/lib/ spec/runner/example_group_runner.rb:14:in`load\_files’  
from /usr/local/lib/ruby/gems/1.8/gems/rspec-1.1.11/lib/  
spec/runner/example\_group\_runner.rb:13:in `each' from /usr/local/lib/ruby/gems/1.8/gems/rspec-1.1.11/lib/ spec/runner/example_group_runner.rb:13:in`load\_files’  
from /usr/local/lib/ruby/gems/1.8/gems/rspec-1.1.11/lib/  
spec/runner/options.rb:98:in `run_examples' from /usr/local/lib/ruby/gems/1.8/gems/rspec-1.1.11/lib/ spec/runner/command_line.rb:10:in`run’  
from /usr/local/lib/ruby/gems/1.8/gems/rspec-1.1.11/bin/  
spec:4

Indeed, there is no such file…

vendor/generators, ls:

```
rspec_controller rspec_model

```

Any insight would be greatly appreciated.

---

<div class="post-metadata">

**Author:** ![eeby](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/ecb155/32.png) [@eeby](https://www.ruby-forum.com/u/eeby)\
**Post date:** [January 7, 2009, 10:05am UTC](https://www.ruby-forum.com/t/no-such-file-to-load-error-when-running-rspec/157082/2 "2009-01-07T10:05:10Z")

</div>

i think this could be a version-conflict. rspec-generator needs rspec  
0.5.15, while you are running rspec 1.1.11. i see you have the older  
version installed. still, you are using the latest rspec-version.  
maybe this results in your problem with missing source files.

---

<div class="post-metadata">

**Author:** ![eeby](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/ecb155/32.png) [@eeby](https://www.ruby-forum.com/u/eeby)\
**Post date:** [January 7, 2009, 3:40pm UTC](https://www.ruby-forum.com/t/no-such-file-to-load-error-when-running-rspec/157082/3 "2009-01-07T15:40:39Z")

</div>

On Jan 7, 1:04 am, MaD [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> i think this could be a version-conflict. rspec-generator needs rspec  
> 0.5.15, while you are running rspec 1.1.11. i see you have the older  
> version installed. still, you are using the latest rspec-version.  
> maybe this results in your problem with missing source files.

Thanks for the reply. I simply deleted all rspec-related gems and  
reinstalled. It works now.

After doing that, these are all the rspec gems I have:

rspec (1.1.11)  
rspec-rails (1.1.11)

rspec\_generator disappeared. I guess it got folded into rspec-rails.

Ethan
