LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Check which version of Ruby is installed? (https://www.linuxquestions.org/questions/linux-newbie-8/check-which-version-of-ruby-is-installed-905613/)

acschnabel 09-29-2011 09:14 AM

Check which version of Ruby is installed?
 
How can I check which version of Ruby is installed on my CentOS 5.6 server?

jdkaye 09-29-2011 09:22 AM

Code:

ruby -v
Like this:
Code:

~$ ruby -v
ruby 1.8.7 (2011-06-30 patchlevel 352) [x86_64-linux]

ciao,
jdk

acschnabel 09-29-2011 10:30 AM

Thanks, that worked.

Code:

ruby 1.8.7 (2009-06-12 patchlevel 174) [x86_64-linux]
This seems to be out of date and unpatched. What can I do to remedy it?

jdkaye 09-29-2011 11:08 AM

You haven't told anyone what distro you're using so I can't really say. Use your package manager (aptitude, yum or something else) and download the latest package. How do you update your machine in general?
jdk

irvken 02-18-2013 10:50 AM

doesn't work for me
 
I'm pretty sure I have removed all vestiges of ruby from my system but "ruby -v" returns misinformation

Code:

root@irvken:/home/sean# ruby -v
ruby 1.9.3p362 (2012-12-25 revision 38607) [x86_64-linux]

when there is no ruby installed!

jkirchner 02-18-2013 01:50 PM

Quote:

Originally Posted by irvken (Post 4894462)
I'm pretty sure I have removed all vestiges of ruby from my system but "ruby -v" returns misinformation

Code:

root@irvken:/home/sean# ruby -v
ruby 1.9.3p362 (2012-12-25 revision 38607) [x86_64-linux]

when there is no ruby installed!

Type in terminal
Code:

which ruby
to see where ruby is.

Might be you think you got it but did not.

irvken 02-18-2013 03:56 PM

Code:

root@irvken:/home/sean# which ruby
/usr/local/bin/ruby

Is it ok to just delete /usr/local/bin/ruby ?

jdkaye 02-18-2013 11:33 PM

what does the following command return?
Code:

aptitude search ruby1.9.3
If the ruby package is marked with an "i" (for installed) then you can try removing it with
Code:

sudo aptitude remove ruby1.9.3
But the fact that ruby is found in /usr/local/bin suggests that it wasn't installed via a package.
jdk

irvken 02-19-2013 03:57 AM

ok it's not installed , what does the v stand for?

Someone else suggested I must have compiled a copy of ruby (which is probable), can I just delete the binary then?

jdkaye 02-19-2013 11:42 PM

From the Aptitude guide:
Code:

i        -        the package is installed and all its dependencies are satisfied.
c        -        the package was removed, but its configuration files are still present.
p        -        the package and all its configuration files were removed, or the package was never installed.
v        -        the package is virtual.
B        -        the package has broken dependencies.
u        -        the package has been unpacked but not configured.
C        -        half-configured: the package's configuration was interrupted.
H        -        half-installed: the package's installation was interrupted.

As you can see, the v-flag stands for "virtual".

Yes, /usr/local/bin is the normal location for things you have compiled yourself. It should be safe to remove it.
jdk


All times are GMT -5. The time now is 08:45 PM.