[英]rspec rails 3.2.3, and ruby 1.9.3 getting cannot load such file errors
When I run: 当我跑步时:
bundle exec rspec spec/requests/static_pages_spec.rb
: bundle exec rspec spec/requests/static_pages_spec.rb
:
I get: 我得到:
c:\Sites\sample_app>bundle exec rspec spec/requests/static_pages_spec.rb
C:/Rails/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rspec-core-2.9.0/lib/rspec/core/conf
iguration.rb:746:in `load': cannot load such file -- c:/Sites/spec/requests/stat
ic_pages_spec.rb (LoadError)
from C:/Rails/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rspec-core-2.9.0/lib/rspec/core/configuration.rb:746:in `block in load_spec_files'
from C:/Rails/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rspec-core-2.9.0/lib/rspec/core/configuration.rb:746:in `map'
from C:/Rails/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rspec-core-2.9.0/lib/rspec/core/configuration.rb:746:in `load_spec_files'
from C:/Rails/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rspec-core-2.9.0/lib/rspec/core/command_line.rb:22:in `run'
from C:/Rails/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rspec-core-2.9.0/lib/rspec/core/runner.rb:69:in `run'
from C:/Rails/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rspec-core-2.9.0/lib/rspec/core/runner.rb:10:in `block in autorun'
I'm getting a similar error to the one contained in this post, however the solution proposed doesn't work for me. 我遇到的错误与此帖子中包含的错误类似,但是提出的解决方案对我不起作用。
spec with guard, rails 3.1.1, and ruby 1.9.3 getting cannot load such file errors 具有防护,rails 3.1.1和ruby 1.9.3的规范无法加载此类文件错误
I've run bundle install
and rails generate rspec:install
but the error remains. 我已经运行了bundle install
并且rails generate rspec:install
但是错误仍然存在。 All the files are in their correct spots, and nothing has changed since last night, so I'm not sure what has happened. 所有文件都在正确的位置,自从昨晚以来没有任何变化,所以我不确定发生了什么。
Any light shed on the situation would be greatly appreciated! 任何情况的光明将不胜感激!
It seems like rspec does not care that you stand in c:\\sites\\sample_app, as it tries to load 似乎rspec不在乎您是否站在c:\\ sites \\ sample_app,因为它试图加载
c:/Sites/spec/requests/static_pages_spec.rb
Try to run rspec with an absolute path: 尝试使用绝对路径运行rspec:
bundle exec rspec c:/Sites/sample_app/spec/requests/static_pages_spec.rb
Make sure that you are executing the bundle exec rspec spec/....
command from the app root directory. 确保您正在从应用程序根目录执行bundle exec rspec spec/....
命令。 If you run the command from a sub-directory, you will get this error. 如果从子目录运行该命令,则会出现此错误。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.