我在 Ubuntu 12.04 LTS 下。
我在代理后面。
我已经安装了 rvm 来管理 ruby 版本。我想安装导轨,但遇到了问题:
test@U205-UBUNTU:~$ gem install rails
ERROR: Could not find a valid gem 'rails' (>= 0) in any repository
ERROR: While executing gem ... (Gem::RemoteFetcher::FetchError)
bad response Forbidden 403 (http://rubygems.org/latest_specs.4.8.gz)
我尝试了不同的方法来强制 gem 使用代理设置:
1. gem install rails --http-proxy=http://10.10.16.8:3128
2. gem install rails -p=http://10.10.16.8:3128
3. export http_proxy=http://10.10.16.8:3128
4. I have added to .bashrc lines:
export http_proxy=http://10.10.16.8:3128
export https_proxy=https://10.10.16.8:3128
5. I have added to /etc/environment lines:
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games"
http_proxy=http://10.10.16.8:3128
https_proxy=https://10.10.16.8:3128
但没有任何帮助。
我仍然收到消息:
test@U205-UBUNTU:~$ gem install rails
ERROR: Could not find a valid gem 'rails' (>= 0) in any repository
ERROR: While executing gem ... (Gem::RemoteFetcher::FetchError)
bad response Forbidden 403 (http://rubygems.org/latest_specs.4.8.gz)
但是apt-get和rvm工作正常。