[rspec-users] (LoadError) no such file to load when using rspec 2.0.0.beta.7, rails 3.0.0.beta3 and ruby 1.9.2 with RVM

Daniel Salmeron Amselem daniel.amselem at gmail.com
Fri Apr 23 09:25:31 EDT 2010


I am trying to run a test for a controller with the "spec" command
like this: spec spec/controllers/account_controller_spec.rb and this
is the result:

damselem at logicmail$ spec spec/controllers/accounts_controller_spec.rb
/Users/damselem/.rvm/gems/ruby-1.9.2-head at rails3/gems/rspec-
core-2.0.0.beta.7/lib/rspec/core/configuration.rb:233:in `require': no
such file to load -- spec/controllers/accounts_controller_spec.rb
(LoadError)
	from /Users/damselem/.rvm/gems/ruby-1.9.2-head at rails3/gems/rspec-
core-2.0.0.beta.7/lib/rspec/core/configuration.rb:233:in `block in
require_files_to_run'
	from /Users/damselem/.rvm/gems/ruby-1.9.2-head at rails3/gems/rspec-
core-2.0.0.beta.7/lib/rspec/core/configuration.rb:233:in `map'
	from /Users/damselem/.rvm/gems/ruby-1.9.2-head at rails3/gems/rspec-
core-2.0.0.beta.7/lib/rspec/core/configuration.rb:233:in
`require_files_to_run'
	from /Users/damselem/.rvm/gems/ruby-1.9.2-head at rails3/gems/rspec-
core-2.0.0.beta.7/lib/rspec/core/runner.rb:37:in `configure'
	from /Users/damselem/.rvm/gems/ruby-1.9.2-head at rails3/gems/rspec-
core-2.0.0.beta.7/lib/rspec/core/runner.rb:24:in `run'
	from /Users/damselem/.rvm/gems/ruby-1.9.2-head at rails3/gems/rspec-
core-2.0.0.beta.7/lib/rspec/core/runner.rb:12:in `block in autorun'


When using "ruby -Ispec spec/controllers/account_controller_spec.rb"
everything works fine. Then, I thought that could be a problem with
the path to the controller spec, so I tried:

"spec ~/Documents/Freelancing/Projects/logicmail/spec/controllers/
accounts_controller_spec.rb" which worked fine. Does anybody know why
is this happening? In the previous versions of rspec, I could run the
first command without any problem, but now I have to use either the
last command with an absolute path or:

"spec -I . spec/controllers/accounts_controller_spec.rb"

Any thought on this?


More information about the rspec-users mailing list