0

I'm very new to coding and I have been learning ruby through the app academy open bootcamp. I have gotten to the Rspec topic, but after installing the gems from the gem file provided in the course:

source "https://rubygems.org"

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

The next step was to run Rspec using bundle exec rspec and I keep getting this error

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>'

I'm using windows 10 ruby version 3.0.2p107 (2021-07-07 revision 0db68f0233) rails version 6.1.4 gem version 3.2.22

I have tried uninstalling then reinstalling ruby on rails, and reinstalling the gem files. I have tried Googling the solution but I can not find a single solution for my specific problem. Any help will be appreciated!

4
  • 6
    Please post the entire error message. You skipped at least one crucial line at the top. Commented Jul 17, 2021 at 15:55
  • 3
    And please post the content of the App Academy/rspec_demo/spec/add_spec.rb:1 - especially the first line because that is where the exception is raised. Commented Jul 17, 2021 at 16:38
  • Especially for someone new to coding - I would strongly advise learning (pure) Ruby before learning Rails. Commented Jul 18, 2021 at 14:28
  • After editing the Gemfile, did you run bundle? Commented Jul 18, 2021 at 23:04

1 Answer 1

1

Don’t know if YMMV on windows but I think the things you’re missing are

$ bundle install

And

$ rspec init

Read up on those

Sign up to request clarification or add additional context in comments.

2 Comments

Sorry for the late reply I have been so busy lately. I read up on $ bundle install and $ rspec like you said, and decided to run the whole process all over again from the start and it finally worked this time, thank you so much for the help
Please hit the upvote button if this helped @Mthunzi

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.