Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bundler using an older Ruby version

I have Ruby 2.3.0 installed in my system. The output of ruby -v is:

ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-linux]

When I try to run Rails using:

bundle exec rails new ~/my-test-app --dev

I get the following error:

Your Ruby version is 2.1.7, but your Gemfile specified 2.3.0

I have both Ruby versions installed. How to make bundle use Ruby 2.3.0 instead of 2.1.7

like image 380
rubyman Avatar asked Oct 18 '22 16:10

rubyman


1 Answers

TL;DR Change the version of Ruby from 2.1 to 2.3 in /usr/local/bin/bundle.

Explanation

To figure out which Ruby bundler is using enter

which bundle

This should print

/usr/local/bin/bundle

Now open the file and change the Ruby version from 2.1 to 2.3

like image 142
Vishnu Ks Avatar answered Oct 21 '22 05:10

Vishnu Ks