I am trying to run ruby on my RPi (Raspbian/Debian distro). I have installed ruby with apt-get command, but it has installed 1.9. 3 version. I wanted newer one, so I removed that one and next, according to some guide, I have installed ruby-install and used it to install ruby 2.1. 5. After some downloading, compiling it has installed ruby to my ~/. Rubies/ruby-2.1. 5 directory.

My problem is that ruby -v still says ruby 1.9.3. I don't know why 1.9. 3 hasn't been fully uninstalled and why it hasn't been updated to the newer one. How can I properly configure my system to acknowledge my new ruby installation?


You may need to update your path in your /home/$your_username/.bashrc to include /path/to/ruby-2.1.5/bin like so:

export PATH="$HOME/rubies/ruby-2.1.5/bin:${PATH}"

Do note that I put it before (aka "at the front" of) the existing path environment variable. You can test this by executing the command which ruby.

"How does the path enviroment variable work in linux?" has more details.

  • this one didn't work for me, I've used chruby with it's autoswitcher Nov 18 '14 at 18:58

Because jasonwryan hasn't posted an answer that I could check as the right one, I'm aswering my own question with his comment-answer. The chruby tool with it's autoswitcher worked great. Again thanks Jason.


Well, there are a lot of ruby version managers, and tools such as rvm, chruby, rbenv and so on.

You may check the whole list of them at https://www.ruby-toolbox.com/categories/ruby_version_management

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.