How to view all installed versions of Ruby and delete old


I am trying to install lorcon2 library on metasploit. I realized both by experience and from what I've read in the forums that lorcon2 library (used by metasploit in wireless attacks) has problems with installations that have multiple ruby versions.

I would like to know how to view all installed versions of ruby in my box. I am using Linux (Kali).

I noticed that ruby comes preinstalled and after issuing:
ruby -v
I get:
ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux]

rvm is not installed by default so I did:

\curl -L | bash -s -- --autolibs=read-fail
source /etc/profile.d/

but now after issuing:
rvm list

I get:
rvm rubies

# No rvm rubies installed yet. Try 'rvm help install'.

My ultimate goal is find all 1.8 versions of ruby and gems, purge them so I keep 1.9 version as the only one.

I am not familiar at all with the ruby language or the ruby terminology so I don't understand what the role of gems, or rvm is.

Thanks in advance.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Use #alternatives command to get the details.
HolyMountAuthor Commented:
I try to apt-get install alternatives but Kali is
E: Unable to locate package alternatives.

I am not familiar with alternatives but I assume it gives you alternative versions installed on your system...
#rvm list

try this
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

HolyMountAuthor Commented:
as stated in my original post, rvm list returns :
rvm rubies

# No rvm rubies installed yet. Try 'rvm help install'.

for all its worth when giving:
ls /usr/lib/ruby
I get:
1.8  1.9.1  vendor_ruby
If you install rubies under rvm rvm list will doe. But if you install from the standard packages you have to use your package manager to view the installed rubies.

I for my part think the rvm way is the better idea.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
HolyMountAuthor Commented:
fridom is right but I also found what was the actual cause of my problems and found an easier solution.

For succesfully installing lorcon2 library for use from metasploit in kali linux, one has to purge the 1.8 of ruby. If you give:

cd /usr/src
apt-get install libpcap0.8-dev libnl-dev
git clone
cd lorcon
make install
cd pylorcon2
python build
python install
# to make lorcon available to metasploit
cd ../ruby-lorcon/
apt-get install ruby-dev
gem install rails
apt-get purge libruby1.8
ruby extconf.rb
make install

then you will be good and you will be able to run the test.rb script with no problems. Appartently ruby 1.9 and 1.8 conflict and they come both preinstalled on Kali.

Thanks for the help fridom and Sandeep_Agarwal_ !
HolyMountAuthor Commented:
alternative more easy and more detailed way for solving my problem
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.