0

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?

Braiam
  • 35,991

3 Answers3

1

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.

bitcycle
  • 111
1

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.

0

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

Nick Roz
  • 165