views:

126

answers:

3

I have just setup a new Ubuntu 10.04 PC and am trying to install some gems.

gerhard@superserver:~$ sudo gem install rake
ERROR:  http://gems.rubyforge.org/ does not appear to be a repository
ERROR:  could not find gem rake locally or in a repository
gerhard@superserver:~$

I thought it was because my HTTP_PROXY was set incorrectly (I am behind a proxy) but it is correct. Also the gem installs correctly without the sudo

gerhard@superserver:~$ gem install rake
WARNING:  Installing to ~/.gem since /var/lib/gems/1.8 and
          /var/lib/gems/1.8/bin aren't both writable.
WARNING:  You don't have /home/gerhard/.gem/ruby/1.8/bin in your PATH,
          gem executables will not run.
Successfully installed rake-0.8.7
1 gem installed
Installing ri documentation for rake-0.8.7...
Installing RDoc documentation for rake-0.8.7...
gerhard@superserver:~$

Any ideas as to what could be wrong or what I should look at to find possible causes for this problem?

A: 

Hi,

take a look at this and this. Maybe it can help!

Michaël
On other PC's behind the same proxy I just set HTTP_PROXY and everything worked fine. But now something is different.
Gerhard
+1  A: 

When you are not using sudo, rubygems is finding your .gemrc file in your home directory. When you use sudo, I think under Ubuntu it doesn't find your .gemrc and uses the "sources" file instead (for me, it's in /var/lib/gems/1.8/gems/sources-0.0.1/lib). Try updating the rubygems source to http://rubygems.org.

If that doesn't work, try installing RVM. Since RVM installs gems without sudo, you won't have to worry about it.

John Glass
A: 

Try to put following content in /etc/gemrc:

---
:sources:
- http://rubygems.org
:update_sources: true
:benchmark: false
:bulk_threshold: 1000
:backtrace: false
:verbose: true
antage
Does not make any difference.
Gerhard