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

use*_*632 2 ruby git ruby-on-rails

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

从app目录运行的所有rails命令都会失败,并显示以下信息:

Undefined local variable or method `git_source' for Gemfile
Run Code Online (Sandbox Code Playgroud)

相关Gemfile部分:

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

spi*_*ann 6

git_source在Bundler中引入1.6.0

要更新捆绑程序,请运行:

$ gem update bundler
Run Code Online (Sandbox Code Playgroud)