我對編碼很陌生,我一直在通過應用學院開放訓練營學習 ruby??。我已經進入了 Rspec 主題,但是在從課程中提供的 gem 檔案中安裝了 gem 之后:
source "https://rubygems.org"
gem "byebug"
gem "rspec", "~> 3.2.0"
下一步是使用 Rspec 運行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>'
我正在使用 Windows 10 ruby?? 版本 3.0.2p107(2021-07-07 修訂版 0db68f0233)rails 版本 6.1.4 gem 版本 3.2.22
我嘗試卸載然后重新安裝 ruby?? on rails,然后重新安裝 gem 檔案。我試過用谷歌搜索解決方案,但我找不到針對我的具體問題的單一解決方案。任何幫助將不勝感激!
uj5u.com熱心網友回復:
不知道 YMMV 是否在 Windows 上,但我認為你缺少的東西是
$ bundle install
和
$ rspec init
閱讀那些
轉載請註明出處,本文鏈接:https://www.uj5u.com/qukuanlian/416217.html
標籤:
