0

Booting up localhost, I type in 'rails s' into my terminal. I get this error:

Traceback (most recent call last):
    5: from bin/rails:3:in `<main>'
    4: from bin/rails:3:in `load'
    3: from /Users/macbookpro/flippingUnleashedCRM/bin/spring:10:in `<top (required)>'
    2: from /Users/macbookpro/flippingUnleashedCRM/bin/spring:10:in `new'
    1: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/bundler/lockfile_parser.rb:95:in `initialize'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/bundler/lockfile_parser.rb:108:in `warn_for_outdated_bundler_version': You must use Bundler 2 or greater with this lockfile. (Bundler::LockfileError)

So, I type in bundler --version to see what I am using. The result is:

Bundler version 2.2.11

I take a look in my Gemfile.lock, I scroll down, and I see:

RUBY VERSION
   ruby 2.5.1p57

BUNDLED WITH
   2.2.11

What the heck is the problem?

Schwern
  • 153,029
  • 25
  • 195
  • 336
raa89
  • 25
  • 8
  • 2
    Not sure, but the error is for Ruby 2.6 (`Ruby.framework/Versions/2.6`) and your Gemfile.lock is for Ruby 2.5.1. Try stopping your [spring](https://github.com/rails/spring) server. You might also have outdated spring wrappers. Try [removing](https://github.com/rails/spring#removal) and reinstalling them. – Schwern Feb 21 '21 at 20:33
  • ^ What worked for me was bypassing Spring. I followed steps 1 and 2 from this link and it worked. Thanks for giving some good pointers. https://fuzzyblog.io/blog/rails/2017/03/20/disabling-spring-in-rails.html – raa89 Feb 25 '21 at 18:30

1 Answers1

1

It seems like a couple things could be going wrong here:

To potentially resolve your immediate issue, try running bundle exec rails s. This will run rails in the context of your bundle.

Secondly, you should also make sure your Ruby version matches the version specified. Like another comment mentioned, you seem to be running on Ruby 2.6 on a project that is on Ruby 2.5. A Ruby version manager like chruby will help you manage your Ruby versions and gem dependencies on each version better.

Joe
  • 1,850
  • 1
  • 13
  • 15