我不能使用“bundle exec rspec”执行rspec

idv4meu8  于 2021-09-29  发布在  Java
关注(0)|答案(1)|浏览(324)

我对编码非常陌生,我一直在通过应用学院公开训练营学习ruby。我已经谈到了rspec主题,但是在从课程中提供的gem文件安装gem之后:

source "https://rubygems.org"

gem "byebug"
gem "rspec", "~> 3.2.0"

下一步是使用 bundle exec rspec 我不断地犯这个错误

from C:/Users/USER/Desktop/App Academy/rspec_demo/spec/add_spec.rb:1:in `require'
        from C:/Users/USER/Desktop/App Academy/rspec_demo/spec/add_spec.rb:1:in `<top (required)>'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/rspec-core-3.2.3/lib/rspec/core/configuration.rb:1226:in `load'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/rspec-core-3.2.3/lib/rspec/core/configuration.rb:1226:in `block in load_spec_files'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/rspec-core-3.2.3/lib/rspec/core/configuration.rb:1224:in `each'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/rspec-core-3.2.3/lib/rspec/core/configuration.rb:1224:in `load_spec_files'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/rspec-core-3.2.3/lib/rspec/core/runner.rb:97:in `setup'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/rspec-core-3.2.3/lib/rspec/core/runner.rb:85:in `run'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/rspec-core-3.2.3/lib/rspec/core/runner.rb:70:in `run'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/rspec-core-3.2.3/lib/rspec/core/runner.rb:38:in `invoke'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/rspec-core-3.2.3/exe/rspec:4:in `<top (required)>'
        from C:/Ruby30-x64/bin/rspec:23:in `load'
        from C:/Ruby30-x64/bin/rspec:23:in `<main>'

我使用的是Windows10Ruby版本3.0.2p107(2021-07-07修订版0db68f0233)rails版本6.1.4GEM版本3.2.22
我尝试过卸载RubyonRails,然后重新安装RubyonRails,然后重新安装gem文件。我曾尝试在谷歌上搜索解决方案,但我找不到针对我的具体问题的单一解决方案。任何帮助都将不胜感激!

7kjnsjlb

7kjnsjlb1#

我不知道你是否在windows上安装了ymmv,但我认为你缺少的是

$ bundle install

$ rspec init

仔细阅读那些

相关问题