Your Ruby version is 2.6.0, but your Gemfile specified 2.5.0
10,177
Solution 1
Run
gem install bundler
or
gem update bundler
which may fix your problem.
Solution 2
I'm using macOS and managed to solve this problem by using rvm
first to install the desired ruby version (2.5.7 in my case).
Step-by-step:
- Install rvm from rvm.io - rvm version may be udpated with:
rvm get head
- Add rvm to your shell configuration, e.g.
~/.bash_profile
:
PATH=$PATH:$HOME/.rvm/bin
source /Users/<YOUR_USER_NAME>/.rvm/scripts/rvm
- Using rvm, install new Ruby version:
rvm install ruby-2.5.7
- Set the current/default version:
rvm use ruby-2.5.7 --default
- Modify your Gemfile to use the new Ruby version. E.g.:
ruby '2.5.7'
- Refresh the current Ruby version based on ./Gemfile by running:
rvm reload
- After installing a new version, from your project dir do:
gem install bundler
bundle update
Related videos on Youtube
Author by
bilal
Updated on June 04, 2022Comments
-
bilal almost 2 years
Having trouble doing bundle. My project is using 2.5.0 but every time i do
ruby -v
it gives meruby 2.6.0p0 (2018-12-25 revision 66547) [x86_64-darwin18]
I am using rbenv and my
rbenv local
is2.5.0
andrbenv global
is2.5.0
Every time I do
Bundle
gives me an errorYour Ruby version is 2.6.0, but your Gemfile specified 2.5.0
I have tried
gem install bundler
but it doesn't solves the problem.source 'http://rubygems.org' ruby '2.5.0' gem 'rails', '5.0'
and my .ruby-version is also
2.5.0
-
nerding_it over 5 yearsDo you mentioned any ruby version in your gemfile? Something like
ruby '2.0.0', :patchlevel => '353'
in your Gemfile -
bilal over 5 yearsjust updated my question and yes i do mention ruby version in gemfile
-
mogbee over 5 yearsDid you add "export PATH="$HOME/.rbenv/bin:$PATH" in your .bashrc or etc?
-
-
bilal over 5 yearsjust deleted the Gemfile.lock and tried to run
bundle install
and gotYour Ruby version is 2.6.0, but your Gemfile specified 2.5.0