Ruby 2.2.2 and rbenv


I installed rbenv through Yast, then followed the wiki at
I skipped all the “installing rbenv” part (steps 1-6) as I already had it, and proceeded with steps 7-8.
rbenv version gave me 2.2.2 while ruby -v still gives me 2.0, so I guess some of the first steps were necessary, but which ones? 3-6 is my guess, but should I run 7-8 again after that?


After some more tests and guesses…
I used rbenv install / rehash / global as root and ruby -v is 2.2.2.
But I cannot seem to have the same for my user, ruby -v stays at 2.0.

See step 7.
Did you run the following? If you don’t, your new bindings haven’t been activated yet.

rbenv rehash

BTW - v2.2.2 was the most recent when the article was written. Today, there are much more recent versions of ruby you can install if you wish.


Thanks for the reply tsu, I did rbenv rehash. I got it sorted out (removed rbenv and tried rvm, picked 2.2.4 this time) but there’s still something fishy with ruby in my project.

> ruby -v
ruby 2.2.4p230 (2015-12-16 revision 53155) [x86_64-linux]
> which ruby
> cat .ruby-version

All seems fine as I need 2.2+ for the new slim files in the project (I was getting syntax errors but the other devs don’t, they told me to update ruby to fix it).

Yesterday I was still seeing the dreaded syntax errors, but today (after reboot) I cannot start the local server:

> rails s
/usr/lib64/ruby/2.0.0/rubygems/dependency.rb:296:in `to_specs': Could not find 'railties' (>= 0) among 18 total gem(s) (Gem::LoadError)

So somehow rails still picks ruby from my system (2.0.0). Ideas?