I had a similar problem with other software installed in /opt. I solved the problem with
- creating an empty directory elsewhere (e.g.
/tmp/ruby) - install the same version that you want to remove in this directory
- ,
/tmp/ruby /opt.
unix :
$ find /tmp/ruby | sed "s/\/tmp\/ruby\//\/opt\//"
, , :
$ find /tmp/ruby | sed "s/\/tmp\/ruby\//\/opt\//" | xargs rm
...