user2970050
user2970050

Reputation: 307

Your Ruby version is 2.5.0, but your Gemfile specified 2.5.1

I keep getting this error Your Ruby version is 2.5.0, but your Gemfile specified 2.5.1

I use rbenv and homebrew. I also realized that I have .asdf working.

Based on other Stackoverflow, I have tried:

2.5.0 % rbenv local 2.5.1 rbenv: version `2.5.1' not installed 2.5.0 % ruby -v ruby 2.5.0p0 (2017-12-25 revision 61468) [x86_64-darwin16]

When i run this command, i get this: 2.5.0 .rbenv % gem env home /Users/annxxxx/.asdf/installs/ruby/2.5.0/lib/ruby/gems/2.5.0

UPDATE:

So all the commands related to Homebrew are not working because it seems my system seems to be looking for ruby in the .asdf file (this version of ruby was 2.5.0) is pointing using .asdf

I updated .asdf to now use 2.5.1 (so now working - but my machine now has multiple copies of 2.5.1)

My conclusion is that I have multiple copies of ruby on my machine. - one set for rbenv/homebrew - one set for .asdf

Question: 1- should i have both of these? 2- I would prefer to remove .asdf ? a- how do i do that? b- once I do that, what do I need to do to get rbenv/homebrew working?

Upvotes: 1

Views: 1683

Answers (1)

rewritten
rewritten

Reputation: 16435

If you use several version managers, you end up having several versions of everything. asdf installs in ~/.asdf/installs/ruby/*, chruby reads from ~/.rubies (where ruby-install installs them), RVM installs in ~/.rvm/rubies, rbenv in ~/.rbenv/versions and rbfu in ~/.rbfu/rubies.

You need to decide on one version manager and configure it so it accepts your projects' configs.

You might go with asdf, set it up so it reads .ruby-version (see https://github.com/asdf-vm/asdf-ruby#ruby-version-file), and remove all the others -- also, make sure you bundle your dependencies inside each project, otherwise you will get a very messy global.

To help with the transition, set up a shell alias for your old version manager (for instance in bash, add alias rbenv="echo 'Use ASDF instead'" to your shell init file -- permutate the "old version manager" and "new version manager" names as needed)

Upvotes: 1

Related Questions