无法在Gemfile中列出的任何gem源中找到gem

时间:2017-10-21 12:02:04

标签: ruby

jonsdirewolf:~/workspace $ bundle install
Could not find gem 'roo (~> 2.7.0)' in any of the gem sources listed in your Gemfile.
Run `bundle install` to install missing gems.

我的宝石文件:

source "http://rubygems.org"
ruby "2.4.0" 
# gem "rails"
gem "mysql2"
gem "activerecord"  
gem 'byebug'
gem 'write_xlsx'
gem 'mechanize'
gem 'pry'
gem 'pry-byebug'
gem "roo", "~> 2.7.0"

我该怎么办?

1 个答案:

答案 0 :(得分:-1)

rubygems.org强制使用HTTPS:

> curl -I http://rubygems.org
HTTP/1.1 301 Moved Permanently
Content-Type: text/html
Location: https://rubygems.org/

我的预感是捆绑商可能不会遵循重定向。

所以解决方法是使用

source "https://rubygems.org"

使用" https"而不是" http"。