Gem cleanup and rails 1.2.6 problem


#1

I’ve updated rails and other gems following:
http://wiki.rubyonrails.org/rails/pages/HowtoUpgrade
When I try to run: gem cleanup, I get the following error:

Cleaning up installed gems…
Attempting to uninstall rails-1.2.6
ERROR: While executing gem … (Gem::InstallError)
Unknown gem rails = 1.2.6

Googling the problem, I found: http://www.ruby-forum.com/topic/170342
Running:
gem uninstall --install-dir -/System/Library/Frameworks/Ruby.framework/
Versions/1.8/usr/lib/ruby/gems/1.8 rails

I get:
ERROR: While executing gem … (Gem::InstallError)
Unknown gem rails >= 0

How can I uninstall rails 1.2.6? also, since gem cleanup gets an
error, I can’t clean up any other gems…

Elle


#2

On Thu, Feb 12, 2009 at 9:22 PM, elle removed_email_address@domain.invalid wrote:

Googling the problem, I found: http://www.ruby-forum.com/topic/170342
Running:
gem uninstall --install-dir -/System/Library/Frameworks/Ruby.framework/
Versions/1.8/usr/lib/ruby/gems/1.8 rails

Become root, and then do it this way:

gem uninstall --install-dir
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8
rails

HTH

Charles


#3

Running it with sudo I get:

ERROR: While executing gem … (Gem::InstallError)
Unknown gem rails >= 0

Do I need to actually sign in as root?

Cheers,
Elle


#4

On Fri, Feb 13, 2009 at 2:43 PM, elle removed_email_address@domain.invalid wrote:

Elle

You should be OK with sudo. Can you post your exact command line, and
the
output from gem list -d rails

HTH

Charles


#5

The problem is with your path. You want /System/Library…
but you are doing -/System/Library…

See the difference?

Cheers–

Charles


#6

Ah…this is a good topic.
I’m new to Ruby while using the Mac. So it seems that Mac’s installed
Ruby can be uninstalled properly as well. Then we can definitely
update it to get the latest version.

Thanks Charles.


#7

gem list -d rails gives me:

*** LOCAL GEMS ***

rails (2.2.2, 1.2.6)
Author: David Heinemeier H.
Rubyforge: http://rubyforge.org/projects/rails
Homepage: http://www.rubyonrails.org
Installed at (2.2.2): /Library/Ruby/Gems/1.8
(1.2.6): /System/Library/Frameworks/Ruby.framework/
Versions/1.8/usr/lib/ruby/gems/1.8

Web-application framework with template engine, control-flow

layer,
and ORM.

Then running:
sudo gem uninstall --install-dir -/System/Library/Frameworks/
Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8 rails
gives me:

ERROR: While executing gem … (Gem::InstallError)
Unknown gem rails >= 0

Elle


#8

Sorry for the late reply – for some reason missed your post till now.
Running the command with the correct path and sudo, asks me if I want
to remove executables: rails in addition to the gem? [Yn]
When I say y, I get an error:
ERROR: While executing gem … (Gem::FilePermissionError)
You don’t have write permissions into the /System/Library/
Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/bin
directory.

Should I sign in as root?

Cheers,
Elle


#9

Signed in as root and made sure I have the correct path and the same
happens. It asks if I want to uninstall rails. I say yes and it gives
me an error:
ERROR: While executing gem … (Gem::FilePermissionError)
You don’t have write permissions into the /System/Library/
Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/bin
directory.

Why is this happening? What should I do?

Thanks,
Elle


#10

Log in as root, and go
to
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/binand
post the owner, group and permissions on one of the files. Also post the
output of “whoami” command.

Thanks.

Charles


#11

Yes, please sign in as root, and be sure you get the path right: is
starts
/System… but not -/System…


#12

Logged as root, went to /System/Library/Frameworks/Ruby.framework/
Versions/1.8/usr/lib/ruby/gems/1.8
Running
% whoami
gives me:
root

Then running
% ls -l
gives me:
total 8
drwxr-xr-x 31 root wheel 1054 31 Oct 16:51 cache
drwxr-xr-x 32 root wheel 1088 31 Oct 16:51 doc
drwxr-xr-x 31 root wheel 1054 31 Oct 16:51 gems
-rw-r–r-- 1 root wheel 4 5 Jan 2008 source_cache
drwxr-xr-x 31 root wheel 1054 31 Oct 16:51 specifications

Thanks,
Elle


#13

I had the same problem as Elle. In my case
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/bin
didn’t exist. I cd’d into
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8
and ran sudo mkdir bin and then I stopped getting the write
permissions error when trying to cleanup my gems.