Uninstall ruby from source

10,099

Solution 1

There is a file in the build directory called .installed.list. This appears to be a list of all the files that get installed.

Solution 2

If ruby was installed in the following way:

./configure --prefix=/usr/local
make
sudo make install

You can uninstall it in the following way:

Check installed ruby version; lets assume 2.1.2

wget http://cache.ruby-lang.org/pub/ruby/2.1/ruby-2.1.2.tar.bz2
bunzip ...
tar xfv ...
cd ruby-2.1.2
./configure --prefix=/usr/local
make
sudo checkinstall
  # will build deb or rpm package and try to install it

After installation, you can now remove the package and it will remove the directories/files/etc.

sudo rpm -e ruby

There might be some artifacts left:

Removing ruby ...
  warning: while removing ruby, directory '/usr/local/lib/ruby/gems/2.1.0/gems' not empty so not removed.
  ...

Remove them manually.

Share:
10,099

Related videos on Youtube

vise
Author by

vise

If you're interested in ruby xor rails, please visit my youtube channel.

Updated on September 17, 2022

Comments

  • vise
    vise over 1 year

    I installed ruby 1.9 on my fedora 13 machine from source. I want to go back and use the older 1.8.6 (which I'll install with yum), unfortunetly it appears that I can't simply uninstall my current version by "make uninstall" (make: *** No rule to make targetuninstall'. Stop.`).

    Is there any way of doing this other than removing each individual file?

  • vise
    vise almost 14 years
    Perhaps I didn't look thoroughly, but I couldn't find any such targets..
  • vise
    vise almost 14 years
    Thank you. In the end I ran "cat .installed.list | xargs rm". It could only delete files (not directories - this is what I wanted), which was good enough for me.