Gemfile未定义的局部变量或方法`git_source'

问题描述:

从github克隆了一个rails应用程序,使用相同版本的rails(5.0.1)在原始开发人员的机器上工作。

Cloned a rails application from github, works on the original dev's machine using the same version of rails (5.0.1).

从应用程序运行任何rails命令目录失败:

Any rails command run from the app directory fails with:

Undefined local variable or method `git_source' for Gemfile

相关的Gemfile部分:

Relevant Gemfile section:

git_source(:github) do |repo_name|
  repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/")
  "https://github.com/#{repo_name}.git"
end


git_source 是在Bundler中引入 1.6.0

更新打包程序运行:

To update bundler run:

$ gem update bundler