Ruby Install Wrong Version


#1

Hi All, when I install Ruby, the install script shows version 2.5.3 but when I run Ruby -v is shows 2.5.1. I moved on thinking the version wouldn’t really matter but when attempting to install Rails, I receive a gem permission error. Could this be related to the Ruby version? Any help is much appreciated. I pasted some of commands I followed based on another topic regarding a Ruby version issue, in case that’s relevant:

installing bundled gems: /home/jduke/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0 (build_info, cache, doc, extensions, gems, specifications)
net-telnet 0.1.1
minitest 5.10.3
test-unit 3.2.7
rake 12.3.0
xmlrpc 0.3.0
power_assert 1.1.1
did_you_mean 1.2.0
installing rdoc: /home/jduke/.rbenv/versions/2.5.3/share/ri/2.5.0/system
installing capi-docs: /home/jduke/.rbenv/versions/2.5.3/share/doc/ruby
Installed ruby-2.5.3 to /home/jduke/.rbenv/versions/2.5.3
/tmp/ruby-build.20181204141901.24479 ~
~

jduke@jduke-VirtualBox:~$ rbenv -v
rbenv 1.1.1-39-g59785f6
jduke@jduke-VirtualBox:~$ rbenv global 2.5.3
jduke@jduke-VirtualBox:~$ ruby -v
ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-linux-gnu]
jduke@jduke-VirtualBox:~$ echo $PATH
/home/jduke/.rbenv/bin:/home/jduke/.rbenv/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
jduke@jduke-VirtualBox:~$ cat ~/.bash_profile
cat: /home/jduke/.bash_profile: No such file or directory
jduke@jduke-VirtualBox:~$


#2

This is the error I receive when attempting to install Rails:

jduke@jduke-VirtualBox:~$ gem install rails
ERROR: While executing gem … (Gem::FilePermissionError)
You don’t have write permissions for the /var/lib/gems/2.5.0 directory.


#3

Hey @Josephfd

What OS are you using?