简体   繁体   English

rspec rails 3.2.3和ruby 1.9.3无法加载此类文件错误

[英]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.

相关问题 具有防护,rails 3.1.1和ruby 1.9.3的规范无法加载此类文件错误 - spec with guard, rails 3.1.1, and ruby 1.9.3 getting cannot load such file errors 在rails上的ruby中进行Rspec测试,无法加载这样的文件webmock / rspec - Rspec test in ruby on rails, cannot load such file webmock/rspec ruby(1.9.3)on rails(3.2.3)Activerecord-odbc-adapter - ruby(1.9.3) on rails(3.2.3) Activerecord-odbc-adapter 获取无法加载此类文件—运行rspec时,请注意 - getting cannot load such file — cucumber-rails when running rspec 193:%1在Windows 7上使用Rails(3.2.3)和MySQL(5.5)上的Ruby(1.9.3)不是有效的Win32应用程序错误 - 193: %1 is not a valid Win32 application error with Ruby (1.9.3) on Rails(3.2.3) with MySQL(5.5) on Windows 7 “ Bundle Exec Rspec”的Ruby on Rails BDD错误无法加载此类文件-ffi(LoadError) - Ruby on Rails BDD Error with 'Bundle Exec Rspec' cannot load such file — ffi (LoadError) Ruby 3.2.3 rake似乎不起作用-或其他原因。 耙子流产了! 无法加载此类文件 - Ruby 3.2.3 rake does not seem to work - or something. Rake aborted! cannot load such file LoadError: cannot load such file — rails_helper (Rails 6 and Rspec) - LoadError: cannot load such file — rails_helper (Rails 6 and Rspec) Rails Rspec `require': 无法加载此类文件 -- rails_helper (LoadError) - Rails Rspec `require': cannot load such file -- rails_helper (LoadError) 无法启动Rails调试器(将Rails 3.1.3与ruby 1.9.3结合使用) - Cannot start the rails debugger (using rails 3.1.3 with ruby 1.9.3)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM