Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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?

share|improve this question
1  
Look at using a tool like chruby... –  jasonwryan Nov 17 '14 at 19:56
    
Or Ruby Version Manager. –  bitcycle Nov 17 '14 at 20:12
    
Thanks jasonwryan, it worked. –  Soul Reaver Nov 17 '14 at 20:23
    
Related: unix.stackexchange.com/questions/102678/… –  slm Nov 17 '14 at 20:59

2 Answers 2

up vote 1 down vote accepted

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.

share|improve this answer
    
You are welcome to accept your own answer as well :) –  jasonwryan Nov 18 '14 at 20:10

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.

share|improve this answer
    
this one didn't work for me, I've used chruby with it's autoswitcher –  Soul Reaver Nov 18 '14 at 18:58

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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