How to completely erase rubigems with rails, etc.

Ok, so I decided that I would be cool and try to use Rails3 in beta. Then everything became difficult to manage, so I got rvm. I installed ruby ​​1.9.2-head in rvm and everything worked, and then restart the computer, later the rails did not start. Therefore, I decided that I would just try to run the ruby ​​system and run the rails into it. same error. Then I removed rails3 and got the rails: no errors like file or directory.

So, now I am royally screwed up, because rails2 is still installed, but will not be removed due to invisible dependencies, as well as with many other random gems. How to completely clear all ruby ​​stones and so that I can start again?

+4
source share
2 answers

I recently had to so simple. I gathered a lot of toughness with the installed ruby ​​and gem system and wanted to clear it all and move everything to work under rvm for various projects.

1. Clean old and damaged

The first thing I did before messing with rvm (or starting the rvm system to get back to the ruby ​​system) was to remove all my gems :

 gem list | cut -d" " -f1 | xargs gem uninstall -aIx 

WARNING: this will remove all ruby ​​gems. If you installed it as root, you can switch to root and start it.

2. Set a new hotness

Now you can run the gem list to see what is left.

Rvm installation time, I recommend blowing off your current installation and installing a new one again:

 rm -rf $HOME/.rvm bash < <( curl http://rvm.beginrescueend.com/releases/rvm-install-head ) 

Now the real trick is to use gemsets to set rails 3, and this is easy if you follow the Wayne Seguin gist :

 rvm update --head rvm install 1.8.7 rvm --create use 1.8.7@rails3 curl -L http://rvm.beginrescueend.com/gemsets/rails3b3.gems -o rails3b3.gems rvm gemset import rails3b3.gems 

One difference is that I am using 1.8.7, since I had problems with 1.9.2-head and RSpec, but 1.8.7 was smooth.

+8
source

You say that you already have Rails 2, and then rvm is installed. Try it if you can remove Ruby and Rails using the package manager of your system (yum, apt, ...)

The error you received is most likely the result of a link to some common place that still exists, but points to a real installation directory that no longer exists.

For example: /usr/bin/ruby exists and points to /usr/local/lib/ruby/1.9.2/bin/ruby , which no longer exists.

After that, manually clear all Ruby and Rails related paths in /usr and its subdirectories.

0
source

Source: https://habr.com/ru/post/1309632/


All Articles