Reputation: 7051
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?
Upvotes: 3
Views: 1560
Reputation: 1100
Try to put following content in /etc/gemrc
:
---
:sources:
- http://rubygems.org
:update_sources: true
:benchmark: false
:bulk_threshold: 1000
:backtrace: false
:verbose: true
Upvotes: 0
Reputation: 368
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.
Upvotes: 2