1

How can I remove Ruby on Rails and all associated gems?

I tried yum remove ruby but get this response:

yum remove ruby
Loaded plugins: fastestmirror, security
Setting up Remove Process
No Match for argument: ruby
Loading mirror speeds from cached hostfile
 * base: mirror01.th.ifl.net
 * extras: mirror01.th.ifl.net
 * updates: mirror01.th.ifl.net
No Packages marked for removal

If I write $rails -v, $ruby -v or $gem -v I still get their versions returned to me, which indicates that they're installed.

5
  • have you tried with yum purge ruby?
    – jpganz18
    May 16, 2013 at 10:43
  • 1
    I get No such command: purge. Please use /usr/bin/yum --help
    – Stefan
    May 16, 2013 at 10:44
  • How did you install it in the first place? yum remove etc. will only work if you installed it with yum and not if you used some ruby tools like gem or whatever they call this.
    – Sven
    May 16, 2013 at 10:49
  • check this post.. serverfault.com/questions/41502/yum-equivalent-of-apt-get-purge
    – jpganz18
    May 16, 2013 at 10:50
  • It was so long ago, I cannot remember how I installed it.
    – Stefan
    May 16, 2013 at 11:08

3 Answers 3

4

try the following,

# yum provides ruby

or

# rpm -qa | grep -i ruby

This will display the RPMs that is currently installed that provides the ruby binary.

Once you have the name of the rpm you can then run the follow to remove the RPM from your system

# yum erase <package_name>

It might be possible that

  1. the ruby rpm was installed with a custom named rpm package
  2. that ruby was compiled with gcc on the current host

If so, then you will need to manually remove ruby libs and binaries from your system path.

You can locate binary by

# which ruby 

Then you can proceed to remove it from your path.

Else search with find

# find / -name "*ruby*"

then proceed to remove the directories from you server.

0

I guess below command would be useful for you to uninstall RVM packages. Please execute one by one.

Commands:

  1. rvm list

    (it will give you what ruby packages are presently installed on your server)

  2. rvm remove ruby_pkg_name

then once successfully executed above commands then check whether ruby uninstalls or not like ruby -v, gem -v, rails -v or which ruby...

hope this will helpful for you!

0

removing ruby from the server i.e CentOs depends upon how you have installed it. If it was install directly without rvm or rbenv then

yum remove ruby

or

   sudo yum remove ruby 

if it is installed using rvm

rvm remove 1.9.3-p551

or

 rvm remove <ruby-version>

if its is installed using rbenv like:

rbenv uninstall 2.1.0

or

rbenv uninstall <ruby-version> 

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .