Search code examples
ruby-on-railsrspecbundlerrspec-rails

Bundler 2 won't run rspec


We recently updated bundler to 2.0.1 in our project. After the update the app runs fine but I can't run rspec. It does run on my co-workers computer which should be pretty identical setup to mine's.

What I tried:

  • bundler update --bundler => completes successfully
  • gem update bundler => completes successfully
  • bundle exec bin/rspec => Error: You must use Bundler 2 or greater with this lockfile.

    • bin/rspec => Error: You must use Bundler 2 or greater with this lockfile.
  • bundle -v => Bundler version 2.0.1

  • bundle exec bundler -v => Bundler version 2.0.1
  • bundle exec rake app:update:bin => completes successfully

Some versions:

  • rspec 3.7.0
  • ruby 2.4.1p111

Solution

  • I think the issue was with my default version of bundler. You can see that with gem list bundler.

    I ended up uninstalling ruby and re-installing it, followed by a fresh installation of bundler 2 and all the other gems. Fixed it.