On Mar 28, 2011, at 8:04 PM, Carlos Torres wrote:

> I'm new to Rails and I was planning on trying out RSpec. When I try to 
> execute the rspec command on Debian v6.0.1, I get the output below:
> 
> k4ru050@DebianBox:~/Desktop/rails_projects/sample_app/spec$ bundle exec rspec 
> spec/controllers


> /home/k4ru050/.rvm/gems/ruby-1.9.2-p180@rails3tutorial/gems/rspec-core-2.0.1/lib/rspec/core/configuration.rb:306:in
>  `load': no such file to load -- 
> /home/k4ru050/Desktop/rails_projects/sample_app/spec/spec/controllers 
> (LoadError)

First, this particular error has nothing to do with rspec or your OS. The rspec 
command is being invoked from ~/Desktop/rails_projects/sample_app/spec, but the 
last argument is spec/controllers. Unless there is a 
/home/k4ru050/Desktop/rails_projects/sample_app/spec/spec/controllers directory 
(with two nested 'spec' directories), this error is raised.

That said, on any OS, you must run the rspec command from the project root.

  k4ru050@DebianBox:~/Desktop/rails_projects/sample_app$ bundle exec rspec 
spec/controllers

This is necessary because there are too many variables for RSpec to reliably be 
run from other locations and detect the LOAD_PATH correctly.

HTH,
David


>       from 
> /home/k4ru050/.rvm/gems/ruby-1.9.2-p180@rails3tutorial/gems/rspec-core-2.0.1/lib/rspec/core/configuration.rb:306:in
>  `block in load_spec_files'
>       from 
> /home/k4ru050/.rvm/gems/ruby-1.9.2-p180@rails3tutorial/gems/rspec-core-2.0.1/lib/rspec/core/configuration.rb:306:in
>  `map'
>       from 
> /home/k4ru050/.rvm/gems/ruby-1.9.2-p180@rails3tutorial/gems/rspec-core-2.0.1/lib/rspec/core/configuration.rb:306:in
>  `load_spec_files'
>       from 
> /home/k4ru050/.rvm/gems/ruby-1.9.2-p180@rails3tutorial/gems/rspec-core-2.0.1/lib/rspec/core/command_line.rb:18:in
>  `run'
>       from 
> /home/k4ru050/.rvm/gems/ruby-1.9.2-p180@rails3tutorial/gems/rspec-core-2.0.1/lib/rspec/core/runner.rb:55:in
>  `run_in_process'
>       from 
> /home/k4ru050/.rvm/gems/ruby-1.9.2-p180@rails3tutorial/gems/rspec-core-2.0.1/lib/rspec/core/runner.rb:46:in
>  `run'
>       from 
> /home/k4ru050/.rvm/gems/ruby-1.9.2-p180@rails3tutorial/gems/rspec-core-2.0.1/lib/rspec/core/runner.rb:10:in
>  `block in autorun'
> 
> The versions I'm using are: Rails v3.0.5, Ruby v1.9.2  installed via rvm.
> 
> Any suggestions on how to find a workaround for this issue?
> 
> Thanks,
> 
> Carlos
_______________________________________________
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users

Reply via email to