I had to update my
Gemfile as received the following error and googling revealed option to update gems.
- rack 2.0.1
- sinatra 2.0.0.rc2
Here is the original failure
An error occurred while loading ./spec/acceptance/expense_tracker_api_spec.rb. Failure/Error: require 'sinatra/base' Gem::ConflictError: Unable to activate sinatra-1.4.8, because rack-2.0.1 conflicts with rack (~> 1.5) # ./app/api.rb:1:in `<top (required)>' # ./spec/acceptance/expense_tracker_api_spec.rb:3:in `require_relative' # ./spec/acceptance/expense_tracker_api_spec.rb:3:in `<top (required)>' # ------------------ # --- Caused by: --- # LoadError: # cannot load such file -- sinatra/base # ./app/api.rb:1:in `<top (required)>' No examples found. Finished in 0.00026 seconds (files took 0.27649 seconds to load) 0 examples, 0 failures, 1 error occurred outside of examples
Initially this failed
bundle install Fetching gem metadata from https://rubygems.org/......... Fetching version metadata from https://rubygems.org/.. Resolving dependencies... Bundler could not find compatible versions for gem "rack": In snapshot (Gemfile.lock): rack (= 1.6.5) In Gemfile: sinatra (= 2.0.0.rc2) was resolved to 2.0.0.rc2, which depends on rack-protection (= 2.0.0.rc2) was resolved to 2.0.0.rc2, which depends on rack rack-test (= 0.6.3) was resolved to 0.6.3, which depends on rack (>= 1.0) sinatra (= 2.0.0.rc2) was resolved to 2.0.0.rc2, which depends on rack (~> 2.0) Running `bundle update` will rebuild your snapshot from scratch, using only the gems in your Gemfile, which may resolve the conflict.
So I ended up running
bundle update which resolved the issue
bundle update Fetching gem metadata from https://rubygems.org/........ Fetching version metadata from https://rubygems.org/. Resolving dependencies... Using coderay 1.1.0 Using diff-lcs 1.3 Installing mustermann 1.0.0 Using rack 2.0.1 (was 1.6.5) Using rspec-support 3.6.0.beta2 Using tilt 2.0.7 Using bundler 1.13.6 Installing rack-protection 2.0.0.rc2 (was 1.5.3) Using rack-test 0.6.3 Using rspec-core 3.6.0.beta2 Using rspec-expectations 3.6.0.beta2 Using rspec-mocks 3.6.0.beta2 Installing sinatra 2.0.0.rc2 (was 1.4.8) Using rspec 3.6.0.beta2 Bundle updated!
The tests now pass
➜ expense_tracker rspec . Finished in 0.03895 seconds (files took 0.37131 seconds to load) 1 example, 0 failures