[DEPRECATED] Your Gemfile contains multiple primary sources.
阿新 • • 發佈:2021-01-13
某次在執行bundler install時,提示警告資訊:
[DEPRECATED] Your Gemfile contains multiple primary sources. Using `source` more than once without a block is a security risk, and may result in installing unexpected gems. To resolve this warning, use a block to indicate which gems should come from the secondary source. To upgrade this warning to an error, run `bundle config set --local disable_multisource true`.
看原因應該是有兩個source源,搜尋了一下專案,果然有兩個源,一個在根目錄/Gemfile,一個在plugin/redmine_messager/Gemfile,這兩個Gemfile在執行bundler時會合併到同一個Gemfile.lock中。
解決方法:
修改plugin/redmine_messager/Gemfile
source 'https://gems.ruby-china.com/'
gem 'slim-rails'
gem 'validate_url'
為
source 'https://gems.ruby-china.com/' do gem 'slim-rails' gem 'validate_url' end
再次執行bundler,沒有報錯了