Filip Bartuzi
Filip Bartuzi

Reputation: 5931

Can't uninstall Rails gem

I was updating rails version when I noticed that uninstalling rails still give you access to it (you can call $ rails new name). I used the following commands in terminal, (I am on OS X using rvm):

 ~  rvm list

rvm rubies

=> ruby-2.0.0-p594 [ x86_64 ]
   ruby-2.1.3 [ x86_64 ]
 * ruby-2.2.0 [ x86_64 ]

# => - current
# =* - current && default
#  * - default

 ~  rails -v
Rails 4.2.0
 ~  gem uninstall rails
 ~  gem list G rails
capistrano-rails (1.1.0)
coffee-rails (4.0.1)
factory_girl_rails (4.3.0)
font-awesome-rails (4.0.3.1)
jquery-rails (3.0.4)
jquery-ui-rails (4.1.1)
rails-deprecated_sanitizer (1.0.3)
rails-dom-testing (1.0.5)
rails-html-sanitizer (1.0.1)
rails-observers (0.1.2)
rails_admin (0.6.0)
rspec-rails (2.14.1)
sass-rails (4.0.1)
sprockets-rails (2.0.1)
 ~  rails -v
Rails 4.2.0 

As you can see, after uninstalling rails, I still have access to it. G in gem list G rails is an alias for |GREP.

How to get rid of Rails?

Upvotes: 4

Views: 3147

Answers (1)

Chris
Chris

Reputation: 788

The only way I've been able to completely purge rails from OSX/Ubuntu as of rails 4 is to uninstall railties, which will remove rails and any associated rails rubygem. If you want to remove a specific version (4.2.0 in your case), you can do the following:

gem uninstall railties -v 4.2.0

Upvotes: 9

Related Questions