Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ruby install for a user is different from sudo?

I need to have at least version 1.9 installed in the system. However, when I run ruby -v in "normal mode" and "sudo mode", they are different:

$ ruby -v
ruby 1.9.3p392 (2013-02-22 revision 39386) [x86_64-linux]
$ sudo ruby -v
ruby 1.8.7 (2011-06-30 patchlevel 352) [x86_64-linux]

If I do which ruby:

$ which ruby
/usr/local/bin/ruby
$ sudo which ruby
/usr/bin/ruby

How do I install Ruby so that it's the same for both of them?

like image 835
PCoelho Avatar asked Sep 08 '26 10:09

PCoelho


1 Answers

For short you can place path /usr/local/bin/ruby for superuser before /usr/bin/ruby.

$sudo echo $PATH

will show you current state of art

like image 148
corvinusz Avatar answered Sep 10 '26 10:09

corvinusz



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!