0
votes

I recently install ruby 2.7.1 using rbenv. I have made sure that .ruby-version and Gemfile file both have 2.7.1 as ruby version. Now i cannot run rails s locally, doing so returns the following output in console:

Warning: the running version of Bundler (2.1.2) is older than the version that created the lockfile (2.1.4). We suggest you to upgrade to the version that created the lockfile by running gem install bundler:2.1.4.
Your Ruby version is 2.7.0, but your Gemfile specified 2.7.1

I have been searching and trying different things for hours but cannot figure out the problem and would be thankful for help.

Following output may help figure out the problem:

  1. curl -fsSL https://github.com/rbenv/rbenv-installer/raw/master/bin/rbenv-doctor | bash

Checking for rbenv' in PATH: /usr/bin/rbenv Checking for rbenv shims in PATH: OK Checking rbenv install' support: /home/imran/.rbenv/plugins/ruby-build/bin/rbenv-install (ruby-build 20200819)
Counting installed Ruby versions: 1 versions
Checking RubyGems settings: OK
Auditing installed plugins: OK

  1. bundle env

Environment

Bundler       2.1.4
  Platforms   ruby, x86_64-linux
Ruby          2.7.1p83 (2020-03-31 revision a0c7c23c9cec0d0ffcba012279cd652d28ad5bf3) [x86_64-linux]
  Full Path   /home/imran/.rbenv/versions/2.7.1/bin/ruby
  Config Dir  /home/imran/.rbenv/versions/2.7.1/etc
RubyGems      3.1.2
  Gem Home    /home/imran/.gem/ruby/2.7.0
  Gem Path    /home/imran/.gem/ruby/2.7.0:/home/imran/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0
  User Home   /home/imran
  User Path   /home/imran/.gem/ruby/2.7.0
  Bin Dir     /home/imran/.gem/ruby/2.7.0/bin
Tools         
  Git         2.25.1
  RVM         not installed
  rbenv       rbenv 1.1.1
  chruby      not installed

Bundler Build Metadata

Built At          2020-01-05
Git SHA           32a4159325
Released Version  true
  1. gem env

RubyGems Environment:

  • RUBYGEMS VERSION: 3.1.2
  • RUBY VERSION: 2.7.1 (2020-03-31 patchlevel 83) [x86_64-linux]
  • INSTALLATION DIRECTORY: /home/imran/.gem/ruby/2.7.0
  • USER INSTALLATION DIRECTORY: /home/imran/.gem/ruby/2.7.0
  • RUBY EXECUTABLE: /home/imran/.rbenv/versions/2.7.1/bin/ruby
  • GIT EXECUTABLE: /usr/bin/git
  • EXECUTABLE DIRECTORY: /home/imran/.gem/ruby/2.7.0/bin
  • SPEC CACHE DIRECTORY: /home/imran/.gem/specs
  • SYSTEM CONFIGURATION DIRECTORY: /home/imran/.rbenv/versions/2.7.1/etc
  • RUBYGEMS PLATFORMS:
    • ruby
    • x86_64-linux
  • GEM PATHS:
    • /home/imran/.gem/ruby/2.7.0
    • /home/imran/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0
  • GEM CONFIGURATION:
    • :update_sources => true
    • :verbose => true
    • :backtrace => false
    • :bulk_threshold => 1000
  • REMOTE SOURCES:
  • SHELL PATH:
    • /home/imran/.rbenv/versions/2.7.1/bin
    • /usr/lib/rbenv/libexec
    • /home/imran/.rbenv/plugins/ruby-build/bin
    • /home/imran/.rbenv/bin
    • /home/imran/.rbenv/shims
    • /home/imran/.rbenv/plugins/ruby-build/bin
    • /home/imran/.rbenv/bin
    • /home/imran/.local/bin
    • /home/imran/bin
    • /usr/local/sbin
    • /usr/local/bin
    • /usr/sbin
    • /usr/bin
    • /sbin
    • /bin
    • /usr/games
    • /usr/local/games
    • /snap/bin
    • /usr/local/texlive/2018/bin/x86_64-linux
  1. my ~/.profile contains following statements:

    export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"
    export GEM_HOME="$(ruby -e 'puts Gem.user_dir')"
    export PATH="$HOME/.rbenv/bin:$PATH"

1

1 Answers

0
votes

Did You try to just update bundler as output said:

gem install bundler:2.1.4

or

gem install bundler
bundle update