我无法使用 'bundle exec rspec' 执行 rspec
I can't execute rspec using 'bundle exec rspec'
我对编码还很陌生,我一直在通过应用学院开放训练营学习 ruby。我已经进入 Rspec 主题,但是在从课程中提供的 gem 文件安装 gems 之后:
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>'
我正在使用 windows 10
ruby 版本 3.0.2p107(2021-07-07 修订版 0db68f0233)
rails 版本 6.1.4
gem 版本 3.2.22
我尝试卸载然后在 rails 上重新安装 ruby,然后重新安装 gem 文件。我已经尝试使用谷歌搜索解决方案,但找不到针对我的特定问题的单一解决方案。任何帮助将不胜感激!
不知道 windows 上是否有 YMMV,但我认为你缺少的东西是
$ bundle install
和
$ rspec init
阅读那些
我对编码还很陌生,我一直在通过应用学院开放训练营学习 ruby。我已经进入 Rspec 主题,但是在从课程中提供的 gem 文件安装 gems 之后:
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>'
我正在使用 windows 10 ruby 版本 3.0.2p107(2021-07-07 修订版 0db68f0233) rails 版本 6.1.4 gem 版本 3.2.22
我尝试卸载然后在 rails 上重新安装 ruby,然后重新安装 gem 文件。我已经尝试使用谷歌搜索解决方案,但找不到针对我的特定问题的单一解决方案。任何帮助将不胜感激!
不知道 windows 上是否有 YMMV,但我认为你缺少的东西是
$ bundle install
和
$ rspec init
阅读那些