我是一名編碼新手,我一直在通過app academy開放訓練營學習ruby。我已經進入了Rspec的主題,但是在從課程中提供的gem檔案中安裝了寶石之后:
我已經進入了Rspec的主題。
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)>'
從C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/rspec-core-3.2.3/lib/rspec/core/configuration.rb:1226:在 `load'中
從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'
從C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/rspec-core-3.2.3/lib/rspec/core/configuration.rb:1224:在 `each'
從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'。
從C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/rspec-core-3.2。 3/lib/rspec/core/runner.rb:97:in `setup'
從C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/rspec-core-3.2.3/lib/rspec/core/runner.rb:85:在 `run'
從C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/rspec-core-3.2.3/lib/rspec/core/runner.rb:70:在 `run'中
從C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/rspec-core-3.2。 3/lib/rspec/core/runner.rb:38:in `invoke'
從C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/rspec-core-3.2.3/exe/rspec:4:in `<top(必填)>'
從C:/Ruby30-x64/bin/rspec:23:在 `load'中
從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
我已經嘗試卸載然后重新安裝ruby on rails,并重新安裝gem檔案。我試著在谷歌上搜索解決方案,但我找不到一個針對我的具體問題的解決方案。希望得到任何幫助!
uj5u.com熱心網友回復:
不知道在windows上是否有YMMV,但我認為你所缺少的東西是
$ bundle install
而且
$ rspec init
閱讀這些內容
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/313801.html
標籤:
