Failed to set gems using `sudo`

I just installed the 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 this was because mine HTTP_PROXYwas installed incorrectly (I am behind the proxy server), but it is correct. Also, the stone is installed correctly withoutsudo

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 on what might be wrong or what should I look for in order to find possible causes of this problem?

+3
source share
2 answers

sudo, rubygems .gemrc . sudo, , Ubuntu .gemrc "sources" ( /var/lib/gems/ 1.8/gems/sources-0.0.1/lib), rubygems http://rubygems.org.

, RVM. RVM sudo, .

+2

/etc/gemrc:

---
:sources:
- http://rubygems.org
:update_sources: true
:benchmark: false
:bulk_threshold: 1000
:backtrace: false
:verbose: true
0

Source: https://habr.com/ru/post/1763027/


All Articles