我用一个非常简单的Gemfile克隆了一个repo:
# Gemfile
gem "rspec"
正在运行bundle install
引发了此错误:
$ bundle install
Your Gemfile has no gem server sources. If you need gems that are not already on your
machine, add a line like this to your Gemfile:
source 'https://rubygems.org'
Could not find rspec-support-3.2.2 in any of the sources
不想修改Gemfile,我创建了~/.gemrc
,如下所示:
# ~/.gemrc
sources:
- http://rubygems.org
然后,我关闭并重新打开了shell窗口。
错误没有改变。我将source "http://rubygems.org"
添加到Gemfile
时解决了错误。
为什么不更新.gemrc
文件来解决错误?