Question

To install the help files for rails (on debian jessie) I looked up Why doesn't ri know anything about Rails? and ran sudo gem install rails --pre --ri. Somehow that installed rails 4 RC 1. I try to get back to rails 3.2.13.

So first I tried to uninstall rails.

$ sudo gem uninstall rails
[sudo] password for root: 
INFO:  gem "rails" is not installed

$ sudo aptitude remove rails
Es werden keine Pakete installiert, aktualisiert oder entfernt.
0 Pakete aktualisiert, 0 zusätzlich installiert, 0 werden entfernt und 64 nicht aktualisiert.
0 B an Archiven müssen heruntergeladen werden. Nach dem Entpacken werden 0 B zusätzlich belegt sein.
# german for nothing left to do

However, I still get

$ rails -v
Rails 4.0.0.rc1

$ which rails
/usr/local/bin/rails

How do I get rid of rails to reinstall it propperly?

Was it helpful?

Solution 2

Not that I think this is a good solution, but what I did (and what finally seems to bring me back to rails 3.2) is the following:

  1. Removing all gems with
    gem list | cut -d" " -f1 | xargs gem uninstall aIx
    (some had to be removed manually)
  2. aptitude purge ruby
  3. aptitude install ruby
  4. gem install rails

OTHER TIPS

You can better remove all rails and dependency files from bin and newly install rails -v3

You can try using gem-prune. Also, this stackoverflow question has lots of scripts to remove gem dependencies and looks like it may have a similar solution to your problem.

However, I would recommend using RVM to avoid these kinds of problems to begin with. Its a version manager so you can set up lots of different versions of Rubies and Gems so they dont conflict with each other. It really will solve many problems like the one you are describing. Do yourself a favor and try it out.

for future perspective, i will suggest you using RVM and you can delete gemset in such type of conditions.

read rvm doc for usage.

https://rvm.io/

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top