Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Uninstall Rails 3 with dependencies?

I like that Rails 3 is so easy to install: gem install rails --pre, and all of the dependencies are automatically installed for you. But, what about uninstalling it? If I just do gem uninstall rails, I still have

actionmailer (3.0.0.beta3)
actionpack (3.0.0.beta3)
activemodel (3.0.0.beta3)
activerecord (3.0.0.beta3)
activeresource (3.0.0.beta3)
activesupport (3.0.0.beta3)

which I want to get rid of. What's the easiest way to do so?

like image 285
Trevor Burnham Avatar asked Jun 08 '10 21:06

Trevor Burnham


People also ask

What is the latest version of Rails?

On the 9th of September 2022 the latest version of rails, 7.0. 4, was released. It was released alongside rails versions 6.1. 7, and 6.0.


2 Answers

if you're planning to upgrade to a newer version of rails, you can do:

sudo gem clean

or in newer versions

sudo gem cleanup

after the newer version has been installed, this uninstall All older versions of All your gems leaving only the latest version in your system.

Note: these days I use RVM gemset and/or bundler to manage my gems, if you're using RVM I find it's a lot simpler this way. For example you can create a new gemset for each project:

rvm gemset create project_name
rvm gemset use project_name
bundle install

anything goes wrong you can just delete the gemset and start again

rvm gemset delete project_name
like image 75
sai Avatar answered Oct 12 '22 20:10

sai


Look at deps(optional):

gem dependency rails -v=3.0.9

Then uninstall all components of the version specified:

gem uninstall actionmailer actionpack activerecord activesupport acriveresource rails -v=3.0.9
like image 29
Grimmo Avatar answered Oct 12 '22 20:10

Grimmo