Google Groups Home
Help | Sign in
Can't install gems with sudo
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  5 messages - Collapse all
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
Gavin Kistner  
View profile
 More options Sep 12 2006, 8:42 pm
Newsgroups: comp.lang.ruby
From: "Gavin Kistner" <gavin.kist...@anark.com>
Date: Wed, 13 Sep 2006 09:42:10 +0900
Local: Tues, Sep 12 2006 8:42 pm
Subject: Can't install gems with sudo
I just built ruby 1.8.5 myself, and now rubygems can't find remote gems when I run it with sudo privs. It can find the gems when I run it as myself, but then it doesn't have priviliges needed to install the gem. Did I miss something obvious?

[Sliver:~] gkistner$ which ruby
/usr/local/bin/ruby
[Sliver:~] gkistner$ which gem
/usr/local/bin/gem
[Sliver:~] gkistner$ ruby -v
ruby 1.8.5 (2006-08-25) [powerpc-darwin8.7.0]
[Sliver:~] gkistner$ gem -v
0.9.0
[Sliver:~] gkistner$ sudo gem install rake
ERROR:  While executing gem ... (Gem::GemNotFoundException)
    Could not find rake (> 0) in the repository
[Sliver:~] gkistner$ gem install rake
ERROR:  While executing gem ... (Errno::EACCES)
    Permission denied - /usr/local/lib/ruby/gems/1.8/cache/rake-0.7.1.gem


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Chris Gehlker  
View profile
 More options Sep 12 2006, 9:13 pm
Newsgroups: comp.lang.ruby
From: Chris Gehlker <canyon...@mac.com>
Date: Wed, 13 Sep 2006 10:13:48 +0900
Local: Tues, Sep 12 2006 9:13 pm
Subject: Re: Can't install gems with sudo

On Sep 12, 2006, at 5:42 PM, Gavin Kistner wrote:

OK, I get:

which ruby
/usr/local/bin/ruby
~ $ which gem
/usr/local/bin/gem
~ $ ruby -v
ruby 1.8.5 (2006-09-10) [powerpc-darwin8.7.0]
~ $ gem -v
0.9.0
~ $ sudo gem install rake
Successfully installed rake-0.7.1
Installing ri documentation for rake-0.7.1...
Installing RDoc documentation for rake-0.7.1...
~ $

You didn't miss anything obvious. I'm afraid that your problem is  
subtle.
--
A young idea is a beautiful and a fragile thing. Attack people, not  
ideas.


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Paul Lutus  
View profile
 More options Sep 12 2006, 9:16 pm
Newsgroups: comp.lang.ruby
From: Paul Lutus <nos...@nosite.zzz>
Date: Tue, 12 Sep 2006 18:16:40 -0700
Local: Tues, Sep 12 2006 9:16 pm
Subject: Re: Can't install gems with sudo

Gavin Kistner wrote:
> I just built ruby 1.8.5 myself, and now rubygems can't find remote gems
> when I run it with sudo privs. It can find the gems when I run it as
> myself, but then it doesn't have priviliges needed to install the gem. Did
> I miss something obvious?

/ ...

> [Sliver:~] gkistner$ sudo gem install rake
> ERROR:  While executing gem ... (Gem::GemNotFoundException)
>     Could not find rake (> 0) in the repository
> [Sliver:~] gkistner$ gem install rake
> ERROR:  While executing gem ... (Errno::EACCES)
>     Permission denied - /usr/local/lib/ruby/gems/1.8/cache/rake-0.7.1.gem

Looks like sudo might be giving you a dodgy path. Try this:

$ echo $PATH
$ sudo echo $PATH

Are they different?

--
Paul Lutus
http://www.arachnoid.com


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Eric Hodel  
View profile
(2 users)  More options Sep 12 2006, 10:27 pm
Newsgroups: comp.lang.ruby
From: Eric Hodel <drbr...@segment7.net>
Date: Wed, 13 Sep 2006 11:27:00 +0900
Subject: Re: Can't install gems with sudo
On Sep 12, 2006, at 5:42 PM, Gavin Kistner wrote:

Your source cache may be corrupt.

Try:

rm /usr/local/lib/ruby/gems/1.8/source_cache

(You also have one in ~/.gem/source_cache)

--
Eric Hodel - drbr...@segment7.net - http://blog.segment7.net
This implementation is HODEL-HASH-9600 compliant

http://trackmap.robotcoop.com


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Phrogz  
View profile
(1 user)  More options Sep 13 2006, 12:21 am
Newsgroups: comp.lang.ruby
From: "Phrogz" <ga...@refinery.com>
Date: 12 Sep 2006 21:21:34 -0700
Local: Wed, Sep 13 2006 12:21 am
Subject: Re: Can't install gems with sudo

Paul Lutus wrote:
> Looks like sudo might be giving you a dodgy path. Try this:

> $ echo $PATH
> $ sudo echo $PATH

> Are they different?

Nope, identical path values.

Eric Hodel wrote:
> Your source cache may be corrupt.

> Try:
> rm /usr/local/lib/ruby/gems/1.8/source_cache

Bingo, that was it! Thanks so much.
(Needed to "sudo rm ..." that file, of course - I include the
information here only for posterity.)

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2008 Google