Rubygems: How completely uninstall Rails gem ?

Created on 23 Apr 2013  路  11Comments  路  Source: rubygems/rubygems

  1. gem update
  2. rails 4.0.0.beta1 installed
  3. rails -v : shows: Rails 4.0.0.beta1
  4. gem uninstall rails -v 4.0.0.beta1 ( gem uninstall rails -v=4.0.0.beta1)
  5. BUT STILL:

rails -v

Rails 4.0.0.beta1

How I can completely remove rails version ?

Most helpful comment

For others hitting this page. gem uninstall railties was the missing step for me.

All 11 comments

What does gem list show? What version of RubyGems are you using?

@drbrain

$ gem -v
2.0.3

$ gem list

* LOCAL GEMS *

actionmailer (4.0.0.rc2, 4.0.0.rc1, 3.2.13)
actionpack (4.0.0.rc2, 4.0.0.rc1, 3.2.13)
activemodel (4.0.0.rc2, 4.0.0.rc1, 3.2.13)
activerecord (4.0.0.rc2, 4.0.0.rc1, 3.2.13)
activerecord-deprecated_finders (1.0.3, 1.0.2)
activeresource (3.2.13)
activesupport (4.0.0.rc2, 4.0.0.rc1, 3.2.13)
arel (4.0.0, 3.0.2)
atomic (1.1.9)
bcrypt-ruby (3.0.1)
builder (3.2.2, 3.2.1, 3.2.0, 3.1.4, 3.0.4)
bundler (1.3.5)
ckeditor (4.0.4, 3.7.3)
climate_control (0.0.3)
cocaine (0.5.1)
coffee-rails (4.0.0, 3.2.2)
coffee-script (2.2.0)
coffee-script-source (1.6.2)
columnize (0.3.6)
daemon_controller (1.1.4)
debugger (1.6.0)
debugger-linecache (1.2.0)
debugger-ruby_core_source (1.2.2)
erubis (2.7.0)
execjs (1.4.0)
fastthread (1.0.7)
hike (1.2.3, 1.2.2)
i18n (0.6.4, 0.6.1)
jbuilder (1.4.2, 1.4.1)
journey (1.0.4)
jquery-rails (3.0.1, 3.0.0)
json (1.8.0)
libv8 (3.16.14.1, 3.11.8.17 x86_64-linux)
mail (2.5.4)
mime-types (1.23)
mini_magick (3.6.0)
mini_portile (0.5.0)
minitest (5.0.4, 5.0.3, 5.0.2, 4.7.4)
multi_json (1.7.6, 1.7.5, 1.7.4)
mysql2 (0.3.11)
nokogiri (1.6.0, 1.5.10, 1.5.9)
orm_adapter (0.4.0)
paperclip (3.4.2)
passenger (4.0.5)
polyglot (0.3.3)
protected_attributes (1.0.1)
quick_magick (0.8.0)
rack (1.5.2, 1.4.5)
rack-cache (1.2)
rack-ssl (1.3.3)
rack-test (0.6.2)
rails (4.0.0.rc2, 4.0.0.rc1, 3.2.13)
railties (4.0.0.rc2, 4.0.0.rc1, 3.2.13)
rake (10.0.4)
rdoc (4.0.1, 3.12.2)
ref (1.0.5)
rubygems-update (2.0.3)
rvm (1.11.3.8, 1.11.3.7, 1.11.3.6)
sass (3.2.9)
sass-rails (4.0.0.rc2, 4.0.0.rc1, 3.2.6)
sdoc (0.3.20)
sitemap_generator (4.1.0, 4.0.1)
sprockets (2.10.0, 2.2.2)
sprockets-rails (2.0.0, 2.0.0.rc4)
sqlite3 (1.3.7)
subexec (0.2.3)
test-unit (2.5.5)
therubyracer (0.11.4)
thor (0.18.1)
thread_safe (0.1.0)
tilt (1.4.1)
treetop (1.4.14, 1.4.12)
turbolinks (1.2.0, 1.1.1)
tzinfo (1.0.0, 0.3.37)
uglifier (2.1.1)
will_paginate (3.0.4)

$ rails -v
Rails 4.0.0.rc2

The rails executable is in the railties gem so you must uninstall in too. Run gem cleanup

@drbrain
I run 'gem cleanup'

But it still as is!

The log given above of 'gem -v' is AFTER 'gem cleanup'

@drbrain
Or I shall launch 'gem cleanup' in one of the project directories using Rails 3.2.13?

For others hitting this page. gem uninstall railties was the missing step for me.

macintosh:code justinveirs$ gem uninstall railties

Select gem to uninstall:

  1. railties-3.2.13
  2. railties-4.0.0
  3. All versions

2

You have requested to uninstall the gem:
railties-4.0.0

coffee-rails-4.0.0 depends on railties (< 5.0, >= 4.0.0.beta)
rails-4.0.0 depends on railties (= 4.0.0)
rails-observers-0.1.1 depends on railties (~> 4.0.0.beta)
sass-rails-4.0.0 depends on railties (< 5.0, >= 4.0.0.beta)
If you remove this gem, these dependencies will not be met.
Continue with Uninstall? [yN] y
Successfully uninstalled railties-4.0.0
macintosh:code justinveirs$ rails -v
Rails 4.0.0
macintosh:code justinveirs$ clear
shit is still showing for me as well. basically, I'm trying to learn rails, and the tutorial I'm using from my friend uses 3.2.13, and my shit reads 4.0.0. so, it's obvious I did something wrong, and now I'm trying to uninstall rails 4.0. and get 3.2.13, however, I'm having user error, perhaps. therefore, would anyone mind holding my hand, please?

@ryanjm: Thanks!

I have rbenv and rails5 beta3 so had to do:

rails uninstall gem
rails uninstall railties
rbenv rehash
rails -v

@ryanjm: Thanks!

I have rbenv and rails5 beta3 so had to do:

rails uninstall gem
rails uninstall railties
rbenv rehash
rails -v

@raddnoa Just tweaking this a bit to:

gem uninstall rails
gem uninstall railties
rbenv rehash
rails -v

... which worked great for me.

rails CLI maps to railties.
This is a misleading design!

Feel free to reach out to the Rails project so that they impovel their documentation for uninstalling Rails. I don't think there's anything we can do about it ourselves. The rails executable is provided by the railties gem and that's a choice of the gem author that rubygems should respect.

Was this page helpful?
0 / 5 - 0 ratings