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.

Stefan
  • 111
  • 1
  • 2
  • 4

3 Answers3

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.

Danie
  • 1,360
  • 10
  • 12
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> 
vidur punj
  • 119
  • 3
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!