rbenv not changing ruby version
Asked Answered
S

31

438

I installed rbenv according to the github directions. I am running OSX but I have tried this on a Ubuntu 12.04 VM and got the same results. The following is what i get in my terminal when I try to change ruby versions:

rbenv versions
* 1.9.3-p0 (set by /Users/user/.rbenv/version)
1.9.3-p125

rbenv global
1.9.3-p0

rbenv rehash

ruby -v
ruby 1.8.7 (2011-12-28 patchlevel 357) [universal-darwin11.0]

which ruby
/usr/bin/ruby

Anyone have any ideas as to why rbenv isn't switching the ruby version like it thinks it is? Also there is no .rbenv file in the local directory that would be causing the ruby version to default to 1.8.7

rbenv local
rbenv: no local version configured for this directory
Skein answered 7/6, 2012 at 22:28 Comment(5)
Have you definitely put the init in your bashrc correctly? What does your $PATH look like?Sad
None of those commands change the Ruby version rbenv is using, but it appears it's not using your default Ruby.Urissa
@Sad was correct. it wasnt in my ~/.bash_profile correctly apparently.Skein
make sure you follow ALL the installation steps for rbenv. See here or my answerOrcus
If ruby was installed through brew, uninstall that first and then use rbenv.Griego
P
849

Check that PATH contains $HOME/.rbenv/shims and $HOME/.rbenv/bin

$ env | grep PATH

Also check that you have the following in your ~/.bash_profile if using bash or ~/.zshenv if using zsh

export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"

NOTE: Make sure it's the last setting in your ~/.bash_profile . I ran into an issue where I installed a program that updated my .bash_profile and reset PATH.

Finally, make sure your $HOME folder doesn't have a .ruby-version file that you may have created by accident if you were to have done $ rbenv local <ruby-version> in your $HOME folder. Doing $ rbenv global <ruby-version> modifies the $HOME/.rbenv/version file, and the existence of a .ruby-version file in the $HOME folder would override the version set by $HOME/.rbenv/version.

From the docs:

Choosing the Ruby Version When you execute a shim, rbenv determines which Ruby version to use by reading it from the following sources, in this order:

The RBENV_VERSION environment variable, if specified. You can use the rbenv shell command to set this environment variable in your current shell session.

The first .ruby-version file found by searching the directory of the script you are executing and each of its parent directories until reaching the root of your filesystem.

The first .ruby-version file found by searching the current working directory and each of its parent directories until reaching the root of your filesystem. You can modify the .ruby-version file in the current working directory with the rbenv local command.

The global ~/.rbenv/version file. You can modify this file using the rbenv global command. If the global version file is not present, rbenv assumes you want to use the "system" Ruby—i.e. whatever version would be run if rbenv weren't in your path.

Petua answered 27/8, 2012 at 22:40 Comment(17)
On OSX, don't forget to log out of your OSX session and then log back in for the changes to your bash profile to take effect.Gambol
Or do exec $SHELL -l (lower L)Lorna
Where do I have to add the "$HOME/.rbenv/shims" and "$HOME/.rbenv/bin"?Eladiaelaeoptene
I made like this: export RBENV_ROOT="$HOME/.rbenv" if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi Working pretty good :) Also check for PATH init's after rbenv declaration.Atthia
For my case, I need to append these two lines into .bashrc (Bash in Ubuntu) and then I got correct ruby version. It does not work if append it into .bash_profile.Katelin
I had this because I was using zsh instead of bash. Solved it using "echo 'if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi' >> ~/.zshenv"Plexus
I just had to refer to the note, and move the imports below my homebrew path update in my .bash_profile.Thatcher
When I typed env | grep PATH I got PATH=/Users/username/.pyenv/shims:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Users/username/.rvm/bin (How do I make it stop looking for RVM? I uninstalled RVM and installed rbenv instead.)Goodbye
Please disregard my last comment. I figured it out. Even though .bash_profile had the correct $PATH, .profile did not. Fixed it.Goodbye
Side note: personally, I switched to asdf. Here's a post about how to do that.. The reason I chose it: it can also manage my node.js versions (and more)Travis
followed steps export PATH="$HOME/.rbenv/bin:$PATH" eval "$(rbenv init -)" and then i get the latest ruby version which is 3.0.0 ( the one i installed) but when i log out of the terminal & log in.. it goes back to system ruby.. 2.0.0p648 (2015-12-16 revision 53162) [universal.x86_64-darwin15].. what i am doing wrong ?? I installed ruby using rbenv.. followed wilsonmar.github.io/ruby-on-apple-mac-osx/#install-rbenv I am on mac os el capitan.Trula
I need to append these two lines into .zshrc and then I got the correct ruby version. OS: MacOS Big Sur 11.2.3(Apple M1)Janelljanella
instead of .bash_profile, .bash_rc worked for me. And the latest rbenv doesn't have a bin folder. You need to add shims folder.Emmeram
% vim ~/.zprofile (mac os use zsh with .zprofile instead of bash with .bash_profile)Cressy
Confirming that this did not work for me until I moved them to the END of ~/.zshrcPicasso
For a slightly more generic version, I believe chruby uses ~/.$(basename $SHELL)rc to infer the correct file to append the above instructions into.Karren
In my case, jetbrains was overriding the RBENV_VERSION environment variable. Make sure you don't forget to select the correct runtime in your IDE if it does 'smart' things like this ;-)Asperity
I
194

I fixed this by adding the following to my ~/.bash_profile:

#PATH for rbenv
export PATH="$HOME/.rbenv/shims:$PATH"

This is what is documented at https://github.com/sstephenson/rbenv.

From what I can tell there isn't ~/.rbenv/bin directory, which was mentioned in the post by @rodowi.

Intemperance answered 25/4, 2013 at 13:57 Comment(6)
+1 for the link. +1 for the answer which does contradict a better voted answer. Which raises a further question - and if anyone can chime in - how can export PATH="$HOME/.rbenv/bin:$PATH work (as it was failing for me)?Ara
There won't be a ~/.rbenv/bin/ if you installed via homebrew or linuxbrew. And you shouldn't have to set up the shims path yourself, as rbenv init does this (and more) for you.Trin
This fixed my problem.Osanna
This should be in the READMESakhuja
Worked for me after hours of trying other stuff. Thanks!Chyme
@Sakhuja it is in the readme. See hereOrcus
G
96

This may be an old question, but Google led me here and, for posterity sake, thought I'd share.

My problem persisted after many of the recommended solutions above. Like the OP, I installed rbenv and then a ruby version, but my laptop defaulted to system. What I had overlooked was that when I ran:

[~/.rbenv] $ rbenv versions
* system (set by /Users/alphadogg/.rbenv/version)
  2.0.0-p247

IOW, it was still defaulting to system. A quick

[~/.rbenv] $ rbenv local 2.0.0-p247

switched it to the new version.

Gluteal answered 15/7, 2013 at 23:41 Comment(5)
Yes - funny how rbenv install guides don't mention running the local command at all. Lots of blogs remind you to run rbenv global but not local. Great answer.Procreate
Same problem. Same solution. (May have to look at submitting a PR to advise when global Ruby version is overruled by a ~/.ruby-version...)Leg
I had to get rid of system by removing with YUM in Centos 7, only after that I could see the correct version selected in rbenvXiphisternum
I'm shocked I had to dig this far for an answer, this is the correct one for me.Toothache
I found that the rbenv versions command said that 2.3.1 was set in .ruby-versions by rvm perhaps. I had stopped using rvm awhile ago and changed to rbenv. Deleted .ruby-versions and ran rbenv versions again and it had the latest selected by rbenv ( be sure you have the eval statement above in .bash_profile!). Now, all works as before. Thanks for helping me get this solved.Chlorohydrin
D
85

First step is to find out which ruby is being called:

$ which ruby

Your system says:

/usr/bin/ruby

This is NOT the shim used by rbenv, which (on MacOS) should look like:

/Users/<username>/.rbenv/shims/ruby

The shim is actually a script that acts like a redirect to the version of ruby you set.

I recommend that for trouble shooting you unset the project specific "local" version, and the shell specific "shell" version and just test using the "global" version setting which is determined in a plain text file in ~/.rbenv/version which will just be the version number "1.9.3" in your case.

$ rbenv global 1.9.3
$ rbenv local --unset
$ rbenv shell --unset

You can do ls -laG in the root of your project folder (not the home folder) to make sure there is no longer a ".ruby-version" file there.

You can use rbenv versions to identify which version rbenv is set to use (and the location and name of the file that is setting that):

$ rbenv versions

NONE OF THAT MATTERS until you set the path correctly.

Use this to make sure your *MacOS will obey you:

$ rbenv init -

Followed by:

$ which ruby

To make sure it looks like:

/Users/<username>/.rbenv/shims/ruby

Then run this to add the line to your profile so it runs each time you open a new terminal window:

$ echo 'eval "$(rbenv init -)"' >> ~/.bash_profile

There are other ways to modify the path, feel free to substitute any of them instead of running the rbenv init.

NOTE: reinstall Rails with:

$ gem install rails

If you were trying to run Ruby on Rails, then you need to have this all working first, then install the rails gem again. A previous install of Rails will use a hard coded path to the wrong ruby and several other things will be in the wrong place, so just install the gem again.

P. S. If your MacOS won't obey you (*mentioned above) then you may have to find another way to modify your path, but that's unlikely to be a problem because "Macs just work" ;)

Downdraft answered 31/8, 2016 at 0:29 Comment(4)
Ah mate, finally! Tried about 25 different solutions before I found this one, thank youBoatright
Well explained solution. Thank you.Kori
this response is the most helpful (and complete) one. One small variant: if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi >> ~/.bash_profile followed by source ~/.bash_profileAra
Don't know why, but running $ rbenv local --unset; rbenv shell --unset and setting the global version worked for me. Even after restoring the .ruby-version file with the same version number, rbenv started working as expected.Reede
F
71

I had this issue when setting up Ruby using rbenv on MacBook Pro Catalina OS and MacBook Pro Big Sur.

Here's how I fixed:

First run the command below to initialize rbenv:

rbenv init

This will give you some instruction on what to do. Basically you will have to open the ~/.zshrc file and add this to the file eval "$(rbenv init -)". You can accomplish this by running the command below:

echo 'eval "$(rbenv init -)"' >> ~/.zshrc

Next, run the command below to set your Ruby version:

rbenv local <your-desired-ruby-version>

In my case, my desired Ruby version was 3.0.1, so it was:

rbenv local 3.0.1

When you are done, quit your terminal using Command + Q, and then open a new terminal, this time when you run the command:

ruby -v 
rbenv versions

You will see that your desired Ruby version has already been set up for you.

Fungi answered 24/6, 2021 at 22:38 Comment(5)
You are a 🌟. Worked on macOS Monterey.Chauvinism
@PHPNoob The OP mentions that AFAICS. Right near the bottom, it says "quit your terminal using Command + Q, and then open a new terminal." Unless I'm missing something, that's specific directions on how to restart the terminal.Outcross
Worked on macOS Venutra 🔥Paynim
Thanks 🙏🏻 works on Ventura tooOvercloud
Thanks a lot, it worked on Ventura M1 Mac tooLapboard
P
46

In my case changing the ~/.zshenv did not work. I had to make the changes inside ~/.zshrc.

I just added:

# Include rbenv for ZSH
export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"

at the top of ~/.zshrc, restarted the shell and logged out.

Check if it worked:

➜  ~ rbenv install 2.4.0
➜  ~ rbenv global 2.4.0
➜  ~ rbenv global
2.4.0
➜  ~ ruby -v
ruby 2.4.0p0 (2016-12-24 revision 57164) [x86_64-darwin16]
Powys answered 2/2, 2017 at 12:55 Comment(4)
This perfectly works. I added that into .bash_profile not /zshenv.Dishonest
Probably it will be necessary to run source ~/.zshrc, but it worked for me . Thanks you.Exum
Works for me, but I don't understand what is the difference. .zshenv was also executed (checked it with echo inside. Oh, and not with bin, but with shims in a PATH.Juster
After trying many suggestions, finally this one works for me. Probably this needs to be added to the official document.Inducement
D
39

Update 2023 (Macbook Ventura+)

Even if you have rbenv installed, your computer could still serve the default ruby version. To fix this, just run the following:

rbenv init

This might give an output like this:

# Load rbenv automatically by appending
# the following to ~/.zshrc:

eval "$(rbenv init - zsh)"

Just open your .zshrc file:

sudo nano ~/.zshrc

(Or you can also open this file with any other text editor)

Add this line:

eval "$(rbenv init - zsh)"

Save the file (if used sudo nano, you can do so like this:) CTRL + X then Y then Enter (For Mac)

Now, refresh your .zshrc profile like this:

source ~/.zshrc

Now type ruby --version, this must give you the ruby version that was provided by rbenv.

Disinfection answered 11/2, 2023 at 15:13 Comment(2)
it was CONTROL X instead of CMD X for me.Purvis
Indeed, it was CTRL + X for me as well. Updating the answer!Disinfection
F
32

Run this command

Add rbenv to bash so that it loads every time you open a terminal

echo 'if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi' >> ~/.bash_profile
source ~/.bash_profile

this will solve your problem Reference

Fiveandten answered 31/8, 2016 at 6:26 Comment(3)
I spent hours to fix this. Finally your solution helped. Thanks!!Fleischman
I also tried all the answers above, none worked for me except this one. ThanksJosefina
thhhhhhhhhhhhhanksUnpack
N
31

I just found this same problem. What I did was uninstall rbenv (via homebrew) and reinstall it. I also added

if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi

into ~/.bash_profile when I reinstalled rbenv. Works perfectly now.

Notus answered 18/8, 2012 at 18:47 Comment(2)
Note for others that came to the same issue as me: For some reasons, which rbenv was working prior so this line was never executed. I fixed it using directly eval "$(rbenv init -)".Emprise
Nice little eval statement for this use case!Kori
T
10

If you are using bash, go to

~/.bash_profile

and add the following line (if it's not already there)

if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi

If you are using Zsh, go to

~/.zshrc

and add the same line of code, at the end of the .zshrc file.

Then simply restart your terminal and it should be fine now.

Tussis answered 16/2, 2019 at 18:38 Comment(1)
People on Mac os Catalina, should follow the zsh instructionScarlatina
E
8

I had the same problem, but caused by Homebrew:

[~]$ rbenv version
2.3.0 (set by /Users/user/.rbenv/version)
[~]$ ruby -v
ruby 2.3.3p222 (2016-11-21 revision 56859) [x86_64-darwin16]
[~]$ which ruby
/usr/local/bin/ruby

Somehow I had installed Ruby via Homebrew too, and the Homebrew path was ahead of the rbenv path in my $PATH. Running brew uninstall ruby fixed it for me.

Extrovert answered 15/1, 2017 at 12:22 Comment(1)
If ruby was installed through brew, it must be uninstalled to use rbenv properlyGriego
P
8

I tried every solution, but nothing worked for me. Even I was including the path in the .zshrc file.

In my case, I'm using MacBook Pro M2 with macOS Ventura 13.2. And I'm using React Native 0.71.2, which needed Ruby 2.7.6 version.

I simply placed the following code in the .zprofile instead of .zshrc, and it worked:

export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init - zsh)"
Proud answered 3/2, 2023 at 15:29 Comment(2)
I was only missing the second line. Once added, closed and reopened the terminal and it worked fineEdin
both of these lines are mandatory. using only single won't workUnivalve
E
7

rbenv help shell

"Sets a shell-specific Ruby version by setting the 'RBENV_VERSION' environment variable in your shell. This version overrides localapplication-specific versions and the global version. should be a string matching a Ruby version known to rbenv.The special version string 'system' will use your default system Ruby. Run rbenv versions' for a list of available Ruby versions."

Provided rbenv was installed correctly, ruby -v will correspond to

rbenv shell 1.9.3-p125

Edana answered 26/1, 2014 at 13:41 Comment(1)
'rbenv shell x.y.z' is what worked for me. The 'rbenv local x.y.z' described in the higher ranked answer above did not work on OS X.Konrad
D
6

run:

rbenv init

After I ran that, when i set my local rbenv version:

rbenv local 2.4.0

then my ruby -v and my rbenv local versions coincided.

Note: You might also want to exit the directory you're in and then go back into it, i've noticed that was necessary for me in order to get things to work.

Darcie answered 29/8, 2017 at 23:52 Comment(0)
P
5

As for me the easiest way to use rbenv along with zsh is adding rbenv to plugins section in .zshrc config. In my case it looks similar to:

# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)
# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
plugins=(git bower rails ruby rbenv gulp npm node nvm sublime)

After that there're no problems when installing, switching, using ruby versions with help of rbenv.

Mind to restart your terminal session after made changes.

Passementerie answered 7/1, 2016 at 15:3 Comment(1)
Only thing that worked for meUntread
D
5

for fish shell user

set --universal fish_user_paths $fish_user_paths ~/.rbenv/shims/
Directional answered 21/1, 2017 at 0:27 Comment(3)
It worked, how did you come about this solution?Recognizor
it works thank you, same question how did you comes with this ?????Arvid
To be honest, I don't remember anymore lol That was 2017 answer and I wonder why this still works though focused on mobile development now so i never use this stuff anymore.Directional
U
5

The accepted answer suggests to add the following:

export PATH="$HOME/.rbenv/bin:$PATH"

This will not work on Mac OSX, which the OP references. In fact, if you install rbenv via brew install rbenv, which is really the only installation method in Mac OSX, since curl -fsSL https://github.com/rbenv/rbenv-installer/raw/master/bin/rbenv-installer | bash will FAIL in OSX, then the rbenv executable will be installed in:

$ which rbenv
/usr/local/bin/rbenv

However, even in OSX, the rbenv root will remain in the $HOME directory:

~ viggy$ rbenv root
/Users/viggy/.rbenv

What does this mean? It means when you install rubies, they will install in the given home directory under .rbenv:

$ rbenv install 2.6.0
$ ls ~/.rbenv/versions
2.6.0

Now the brew installation did some work that you would have to perform manually in Linux. For example, in Linux, you would have to install ruby-build manually as a plugin:

$ mkdir -p "$(rvbenv root)/plugins"
$ git clone https://github.com/rbenv/ruby-build.git "(rbenv root)"/plugins/ruby-build

This is already done with the homebrew installation. There is one important step that must be done in the homebrew installation, as in the Linux installation. You must add the rbenv shims to your path. In order to do that, when your shell starts, you have to evaluate the following command (which will in turn add the rbenv shims to the beginning of your $PATH):

$ vim ~/.bash_profile
eval "$(rbenv init -)"
$ source ~/.bash_profile

Now when you run echo $PATH, you will see the rbenv shims:

$ echo $PATH
/Users/viggy/.rbenv/shims:

Now check your ruby version and it will reflect the rbenv ruby installed:

ruby -v
ruby 2.6.0p0 
Upholstery answered 26/3, 2020 at 2:40 Comment(0)
B
5

Adding the following to .bashrc works for me -

export PATH="$HOME/.rbenv/shims:$PATH"

Bricebriceno answered 27/11, 2022 at 3:59 Comment(1)
this is exactly what the accepted answer of 2020 says .Obe
B
3

I came to the same problem. Fixed this by run the rbenv global command with sudo. I think it was something permission problem.

update: I finally found the solution. There was one same file "version" on my mac, which is under /usr/local/Cellar/rbenv/0.3.0/. I think it was created by mistake occasionally. you should remove it.

Berlin answered 29/7, 2012 at 11:17 Comment(0)
L
3

When I had these symptoms, the problem turned out to be that install had failed halfway through for the new Ruby version I was trying to switch to, without me noticing. The fix was to delete & reinstall it.

(This meant that even though ruby 1.9.3 showed up in the rbenv list of available versions, it didn't have an executable on the path where rbenv assumed it would. Since rbenv tries to change your ruby version just by prepending a location to your path, if there's nothing actually in the location it prepends, your OS will happily continue searching your default path and find your system version, in my case like the question's 1.8.7.)

Lacroix answered 2/11, 2012 at 11:46 Comment(0)
A
3

Make sure the last line of your .bash_profile is:

export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"
Ayana answered 30/4, 2017 at 5:37 Comment(0)
M
2

This happened to me right after I reinstalled rbenv. Apparently I had a .ruby-version file in my home directory, specifying a version that no longer existed. Once I deleted the file, everything worked.

Metameric answered 14/12, 2013 at 1:19 Comment(0)
O
1

There a lot of of misleading answers that work. I thought it was worth mentioning the steps from the rbenv README.

  1. $ brew install rbenv
  2. $ rbenv init and follow the instructions it gives you. This is what I got:
~ $ rbenv init
# Load rbenv automatically by appending
# the following to ~/.bash_profile:

eval "$(rbenv init -)"

I updated my ~/.bash_profile...

  1. Close terminal and open it again
  2. Verify it's working correctly by running:
$ curl -fsSL https://github.com/rbenv/rbenv-installer/raw/master/bin/rbenv-doctor | bash
  1. Now just install the version you want by doing: rbenv install <version>
Orcus answered 26/12, 2020 at 21:46 Comment(0)
T
1

Linux / Ubuntu Users Step 1:

$ rbenv versions
  system
  2.6.0
* 2.7.0 (set by /home/User/Documents/sample-app/.ruby-version) #Yours will be different
  2.7.2

Step 2:

$ nano /home/User/Documents/sample-app/.ruby-version

Step 3:

$ ruby -v
ruby 2.7.2p137 (2020-10-01 revision 5445e04352) [x86_64-linux]
Truckage answered 31/12, 2020 at 10:12 Comment(0)
T
0

Strangely, rbenv version did not set the .rbenv file.

Check with: ls -ltra --> to see that a rbenv was written.

Tallie answered 21/6, 2012 at 20:35 Comment(0)
S
0

You could try using chruby? chruby does not rely on shims, instead it only modifies PATH, GEM_HOME, GEM_PATH.

Supportive answered 21/11, 2012 at 7:3 Comment(0)
A
0

I forgot to delete rvm before installing rbenv. I deleted rvm and re-installed rbenv, but system still wasn't using the version of Ruby being designated as global by rbenv. I tried shutting Terminal, but it only worked once I restarted the whole machine.

Atomic answered 3/3, 2014 at 6:37 Comment(0)
S
0

All the other answers here give good advice for various situations, but there is an easier way.

The rbenv docs point us to the rbenv-doctor diagnostic tool that will quickly verify all these potential pitfalls on your system:

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

When all is well, you'll see this:

$ curl -fsSL https://github.com/rbenv/rbenv-installer/raw/master/bin/rbenv-doctor | bash                                     <aws:hd-pmp-developer>
Checking for `rbenv' in PATH: /usr/local/bin/rbenv
Checking for rbenv shims in PATH: OK
Checking `rbenv install' support: /usr/local/bin/rbenv-install (ruby-build 20201005)
Counting installed Ruby versions: 1 versions
Checking RubyGems settings: OK
Auditing installed plugins: OK

Now, if we break one of those expectations (e.g. remove rbenv-install), the tool will point us directly to the problem, with a link to how to fix it:

$ mv /usr/local/bin/rbenv-install rbenv-install-GONE
                                                                      
$ curl -fsSL https://github.com/rbenv/rbenv-installer/raw/master/bin/rbenv-doctor | bash                                     
Checking for `rbenv' in PATH: /usr/local/bin/rbenv
Checking for rbenv shims in PATH: OK

===> Checking `rbenv install' support: not found <===
  Unless you plan to add Ruby versions manually, you should install ruby-build.
  Please refer to https://github.com/rbenv/ruby-build#installation

Counting installed Ruby versions: 1 versions
Checking RubyGems settings: OK
Auditing installed plugins: OK
Savagism answered 6/11, 2020 at 19:42 Comment(0)
K
0

Adding eval "$(rbenv init -)" to the .bash_profile on my mac resolved this issue. rbenv local ruby -v gave the set

Kurtzig answered 29/3, 2021 at 18:5 Comment(0)
F
-1

enter image description here

Apparently, it worked for me when I used the Rosetta terminal

You can try doing the same thing using Rosetta terminal

by going into

Finder > Utilities > Terminal > Get Info

Fortyish answered 23/11, 2022 at 7:7 Comment(0)
P
-4

I will suggest do not use rbenv has couple of issues.

  1. it does not come with bundle version once you install ruby
  2. most of time create bundler version pickup issue while running bundle install

To cut down this much effort,I would suggest to use rvm, make life easier. follow this link to install rvm https://nrogap.medium.com/install-rvm-in-macos-step-by-step-d3b3c236953b

Prynne answered 16/12, 2021 at 13:44 Comment(1)
This doesn't solve the OP's problem if their organization is using rbenv or if they must use rbenv for some other reason. It's unrelated to the questionStethoscope

© 2022 - 2024 — McMap. All rights reserved.