This post would demo how to solve the “ruby command not found” after installing the ruby using rbenv, eg. When you
input this command to install ruby:
After install successfully , you input :
You got this:
ok, let’s begin to solve this.
Environments
rbenv 1.1.1-30-gc8ba27f with plugin ‘ruby-build’ installed
ruby 2.5.1 installed by rbenv
OS CentOS 6.8
Debug
Before knowing how to solve this problem, let’s check it first by using the rbenv doctor:
You got this:
We found that we can run rbenv init to check the problem:
Problem solving
After debuging, We know that we have missed to append something to ~/.bash_profile,so we open ~/.bash_profile, and append
the ** eval “$(rbenv init -)” ** to it, the file looks like this:
Then you can logout and login again, run this:
You can find detail documents about the ruby here: