I am having some issues while trying to uninstall a gem. I am using Mac
OS 10.6.2 system. Following are commands I tried to execute to uninstall
rails gem, but it didn’t work.
{{{
$ sudo gem uninstall rails
Password:
INFO: gem “rails” is not installed
$ sudo gem uninstall rails -v 2.3.5
INFO: gem “rails” is not installed
Specified version
$ sudo gem uninstall rails -v 2.3.5 --debug
Exception NameError' at /Library/Ruby/Site/1.8/rubygems/command_manager.rb:177 - uninitialized constant Gem::Commands::UninstallCommand Exception
Gem::InstallError’ at
/Library/Ruby/Site/1.8/rubygems/uninstaller.rb:73 - gem “rails” is not
installed
INFO: gem “rails” is not installed
$ sudo gem uninstall rails-2.3.5
Password:
INFO: gem “rails-2.3.5” is not installed
}}}
Although gem command output says ‘rails is not installed’, it is listed
in the installed gems list. Also, the gem which command is unable to
find it (tried with both sudo and non-sudo privileges).
{{{
$ sudo gem list rails
*** LOCAL GEMS ***
rails (2.3.5, 1.2.6)
$ sudo gem list rails -i
true
$ sudo gem which rails
ERROR: Can’t find ruby library file or shared library rails
$ gem contents rails
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/rails-2.3.5/README
…
…
}}}
The rails gem is installed (not sure if it comes pre-installed with Mac
OS X) in ‘/System/Library/Frameworks/Ruby.framework/Versions/1.8/’.
I tried ‘uninstall’ and ‘which’ commands with some other gems installed
in
‘/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems’
and ‘/Library/Ruby/Gems/1.8/gems’ locations, but couldn’t understand
what was going on. For example, ‘which’ is able to find xmpp4r gem here
(failed with rails command as mentioned earlier), but ‘uninstall’
command
is failing.
{{{
$ gem which xmpp4r
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/xmpp4r-0.4/lib/xmpp4r.rb
$ gem uninstall xmpp4r
INFO: gem “xmpp4r” is not installed
$ sudo gem uninstall xmpp4r
INFO: gem “xmpp4r” is not installed
}}}
Any help on what might be wrong here? Am I missing something obvious the
way gem commands work?
- thanks,
neuby.r