Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regarding ruby-install extension like ruby-removal to letgo old rubies installations #269

Open
thapakazi opened this issue Apr 15, 2016 · 9 comments
Labels

Comments

@thapakazi
Copy link

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 💭 .
For now I am writing/using my own version of shell function to clean the old ones I no longer use.

@postmodern
Copy link
Owner

postmodern commented May 7, 2016

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.

@thapakazi
Copy link
Author

thapakazi commented May 18, 2016

nice one @postmodern, if availabe :(
Most of time I clean up the ruby src/* files used for installation, 🙅

@mvz
Copy link

mvz commented Aug 30, 2016

I usually just remove the whole installation directory for old ruby versions. Not sure if that works for system installations, though.

@FranklinYu
Copy link

Isn't it just

rm -rf ~/.rubies/ruby-2.2.0

or am I missing anything?

@mvz
Copy link

mvz commented Nov 13, 2016

@FranklinYu that's what I use, but AIUI you can make ruby-install do a system installation and then it may be harder.

@FranklinYu
Copy link

@mvz Oh, because the files scatter everywhere? (Sorry I never tried messing with system Ruby.)

@ILMostro
Copy link

ILMostro commented Apr 21, 2021

@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.

@lacostenycoder
Copy link

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?

@postmodern
Copy link
Owner

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants