Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/56.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails 在代理后面的Ubuntu上安装Rails_Ruby On Rails_Ruby_Ruby On Rails 3_Ubuntu - Fatal编程技术网

Ruby on rails 在代理后面的Ubuntu上安装Rails

Ruby on rails 在代理后面的Ubuntu上安装Rails,ruby-on-rails,ruby,ruby-on-rails-3,ubuntu,Ruby On Rails,Ruby,Ruby On Rails 3,Ubuntu,我在Ubuntu 12.04 LTS下。 我支持代理。 我安装了rvm来管理ruby版本。 我想安装rails,但遇到了以下问题: 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 re

我在Ubuntu 12.04 LTS下。
我支持代理。
我安装了rvm来管理ruby版本。 我想安装rails,但遇到了以下问题:

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 getrvm工作正常。

我的代理设置存在问题,限制访问Internet。 对不起,问题不正确)。这里的解决方案是(作为超级用户)将以下内容添加到文件
/etc/environment

http_proxy=http://<proxy-host>:<proxy-port>
http\u proxy=http://:
在哪里

  • 是代理计算机的真实名称(或ip地址)
  • 是您必须使用的端口号
您不必为Gem设置代理