ruby-install
ruby-install copied to clipboard
Regarding ruby-install extension like ruby-removal to letgo old rubies installations
I was recently bundling lots of ruby-projects and got stumbled upon low-disk space problem, and after few serlock inspections, found out i was carrying multiplle old version of rubies:
➜ ~ chruby
jruby-1.7.13
ruby-1.9.3-p547
ruby-2.1.2
ruby-2.1.4
ruby-2.1.5
ruby-2.2.0
ruby-2.2.1
ruby-2.2.2
ruby-2.2.3
* ruby-2.3.0
Since I switched to chruby+ ruby-install from giant: rvm never had a single hunch that it was a wrong choice. But I wish there exists some installed ruby removal version of ruby-install :thought_balloon: . For now I am writing/using my own version of shell function to clean the old ones I no longer use.
I plan on adding a ruby-uninstall
command. It should cd
back into the ruby's src dir and run make uninstall
or rake uninstall
, if available.
nice one @postmodern, if availabe :(
Most of time I clean up the ruby src/*
files used for installation, :no_good:
I usually just remove the whole installation directory for old ruby versions. Not sure if that works for system installations, though.
Isn't it just
rm -rf ~/.rubies/ruby-2.2.0
or am I missing anything?
@franklinyu that's what I use, but AIUI you can make ruby-install do a system installation and then it may be harder.
@mvz Oh, because the files scatter everywhere? (Sorry I never tried messing with system Ruby.)
@FranklinYu that's what I use, but AIUI you can make ruby-install do a system installation and then it may be harder.
Kind of defeats the purpose of using ruby-install
, doesn't it? Although, I'm not sure what the purpose of the --system
option is, besides installing the specified ruby version into the /usr/local/
directory. If that's all, then this could be removed altogether in favor of using the --rubies-dir
option; anyone still wanting to deal with the headache of mixing system-wide tools and libraries with those provided by ruby-install
can spend time trying to clean up when they try to uninstall a version that's no longer needed. This is a bad practice, in general. Implementing an "uninstall" option should not be hindered by attempting to solve problems that stem from bad practices, ill-advised or non-standard use, IMHO.
As it stands, it should be easy enough to implement this via an --uninstall
option, which could at least run make uninstall
in the source directory and print a message about manually cleaning up the ~/.gems/
directory and/or .rubies
directory.
I ran ruby-install --system ruby 2.7.7
and now need to revert to the previous version. But I think I borked it. The server I'm using had update-alternatives
selecting the ruby version from a 2.5 to a 2.6 and was set to 2.6. I need to return things to this state, but not sure how to go about it without blowing up the server. Can anyone help with this please?
@lacostenycoder cd
into /usr/local/src/ruby-2.7.7
and run sudo make uninstall
. That should remove the files installed into /usr/local
. I eventually plan on adding a ruby-uninstall
command that can safely remove installed rubies.