Recently, I faced with the problem of not syncing ruby version with my Mac.
My project requires ruby version >= 2.2.2 but default version is 2.0.0.
I haved installed ruby 2.3.1 on my rbenv (ruby version manager) and set it global, but when i bundle install, there comes some error liked:
activesupport-5.0.0 requires ruby version >= 2.2.2, which is incompatible with the current version, ruby 2.0.0p648
Even rbenv version shows:
2.3.1 (set by /Users/duchoang/.ruby-version)
I checked back with ruby -v, it shows 2.0.0. Oh shit what happened?
I searched and they said that I have to install ruby-build, ok but after that I reallized that it’s not the cause:
brew install rbenv ruby-build
I reallized that I’ve switched to zsh, so instead of ~/.bash_profile I need to rerun the following command to ~/.zshrc:
$ echo 'if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi' >> ~/.zshrc $ source ~/.zshrc