我对编程非常陌生,我一直在通过app academy open bootcamp学习ruby。我已经谈到了Rspec主题,但是在从课程中提供的gem文件安装gem之后:
source "https://rubygems.org"
gem "byebug"
gem "rspec", "~> 3.2.0"下一步是使用bundle exec rspec运行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>'我使用的是Windows10 ruby版本3.0.2p107 (2021-07-07修订版0db68f0233) rails版本6.1.4 gem版本3.2.22
我尝试过卸载和重新安装ruby on rails,然后重新安装gem文件。我已经尝试在谷歌上搜索解决方案,但我无法找到我的具体问题的单一解决方案。任何帮助都将不胜感激!
发布于 2021-07-20 18:04:32
不知道windows上是否有YMMV,但我认为你错过的东西是
$ bundle install和
$ rspec init请阅读这些内容
https://stackoverflow.com/questions/68421509
复制相似问题