Search code examples
ruby-on-railsrubyrubygemsdebianreinstall

How can I remove and reinstall rails 3.2.13


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?


Solution

  • 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