rbenv can't change global ruby version

qodot

My Mac OS X has a default ruby.

$ ruby -v
ruby 2.0.0p451 (2014-02-24 revision 45167) [universal.x86_64-darwin13]

I installed rbenv and ruby version 2.1.2.

$ rbenv versions
  system
* 2.1.2 (set by /Users/sdw/.rbenv/version)

and I tried to set the global ruby version to 2.1.2, but nothing happened.

$ rbenv global 2.1.2
$ ruby -v
ruby 2.0.0p451 (2014-02-24 revision 45167) [universal.x86_64-darwin13]

So I tried to do the same thing with command sudo, but the result is the same.

$ sudo rbenv global 2.1.2
$ ruby -v
ruby 2.0.0p451 (2014-02-24 revision 45167) [universal.x86_64-darwin13]

How can I change my global ruby version to 2.1.2? I never installed rvm or other ruby version managing system.

spickermann

Did you add the following lines to your ~/.bash_profile?

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

See: https://github.com/sstephenson/rbenv#installation

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

I want to change ruby version by rbenv, but I can't reset my 'which ruby'

Why can't rbenv install the latest Ruby version on Ubuntu?

Rbenv vagrant global ruby version unchanged

rbenv not changing ruby version

Why cant I change my ruby version with rbenv?

rbenv install not downloading ruby version

rbenv working but ruby version not changing

How to use Ruby 2.6.6 when rbenv can't find it?

rbenv Ruby version 2.7.6 got ruby-build error and won't install

Docker container knows rbenv global but not ruby

Install Latest Stable Version of Ruby Using rbenv

Vagrant provisioning - installing ruby version on rbenv fails

rbenv doesn't work on ubuntu with rbenv and ruby-build?

can't not change global variable in a function

my global can't change in the def of a class

Rbenv Version 2.1.1, but Error Says Ruby Version is 2.0.0

rbenv ruby on rails global vs local vs shell

Wrong ruby version, can't install rvm

How to use specify version of ruby for shell script with rbenv?

Git post-receive hook not using ruby version specified by rbenv

Mavericks, RBENV, Your Ruby version is 2.0.0, but your Gemfile specified 2.1.1

rbenv Your Ruby version is 2.0.0, but your Gemfile specified 2.1.2

Capistrano rbenv - Ruby version not installed witn dry run

After installing ruby 2.2.3 with rbenv it has a different version

rbenv & ruby-build not showing the same list of version

how to change node version? "Your requested "node" version "8" doesn't match your global version "10"

Can't change gradle version intellij

Upgrading Global Ruby Version on macOS

Can RVM, rbenv and Homebrew create problems in a working Ruby on Rails env?