centos安装bundler失败的解决方案

今天在centos服务器上安装beef-xss时要安装bundler。一直不成功。最后找到解决方案如下:

安装Bundler Gem

sudo gem install bundler --no-ri --no-rdoc

安装过程中会出现下面的错误:

[root@h77 ruby-2.0.0-p353]# gem install bundler --no-ri --no-rdoc

ERROR:  Could not find a valid gem 'bundler' (>= 0), here is why: Unable to download data from https://rubygems.org/ - Errno::ETIMEDOUT: Connection timed out - connect(2) (https://rubygems.org/latest_specs.4.8.gz)

是因为国内网络导致rubygems.org存放在Amazon S3上面的资源文件间歇性连接失败,用国内的RubyGems镜像(参见http://ruby.taobao.org/)替换官方镜像,方法如下:

[root@h77 ruby-2.0.0-p353]# gem sources --remove https://rubygems.org/

https://rubygems.org/ removed from sources

[root@h77 ruby-2.0.0-p353]# gem sources -a https://ruby.taobao.org/

https://ruby.taobao.org/ added to sources

[root@h77 ruby-2.0.0-p353]# gem sources -l

*** CURRENT SOURCES ***

 

https://ruby.taobao.org/

[root@h77 ruby-2.0.0-p353]# gem install bundler --no-ri --no-rdoc

Fetching: bundler-1.7.6.gem (100%)

Successfully installed bundler-1.7.6

1 gem installed




ruby的gem和boundle安装解决办法

博客分类:   Linux
 
gem和boundle安装在国内被墙,淘宝提供了淘宝提供了RubyGems的国内镜像站点,解决办法是: 
对于gem: 
Xml代码   收藏代码
  1. $ gem sources --remove https://rubygems.org/  
  2. $ gem sources -a http://ruby.taobao.org/  
  3. $ gem sources -l  
  4. *** CURRENT SOURCES ***  
  5.   
  6. http://ruby.taobao.org  
  7. # 请确保只有 ruby.taobao.org  
  8. $ gem install rails  


对于boundle: 
修改Gemfile文件,将默认的 
source 'http://rubygems.org' 
改成 
source 'https://ruby.taobao.org/'

网上找到的方案一直不成功,就是因为最后一句,要把http换成https

你可能感兴趣的:(渗透测试)