簡體   English   中英

在沒有.gemspec的情況下使用bundler獲取git repo的依賴關系

[英]Getting dependencies of git repo without .gemspec with bundler

我正在嘗試使用bundler安裝一個git版本的heckle。

起初我試過了

gem "heckle", :github => 'phiggins/heckle', :branch => "ruby_parser"

但那並沒有奏效

Could not find gem 'heckle (>= 0) ruby' in git://github.com/phiggins/heckle.git (at master).
Source does not contain any versions of 'heckle (>= 0) ruby'

然后我根據https://stackoverflow.com/a/3952045/38765指定了heckle的版本,但是bundler沒有嘗試安裝heckle的任何依賴項:

$ bundle exec heckle

給我

cannot load such file -- ruby_parser (LoadError)

當沒有.gemspec時,如何告訴bundler找到heckle的依賴?

你不能。 .gemspec是應該找到依賴.gemspec的地方時, .gemspec如何知道依賴項。

如果你看看Rakefile你會看到:

dependency 'ruby_parser', '~> 2.3.1'
dependency 'ruby2ruby', '~> 1.3.0'
dependency 'ZenTest',   '~> 4.7.0'

您只需手動將這些添加到您的Gemfile

gem 'ruby_parser', '~> 2.3.1'
gem 'ruby2ruby',   '~> 1.3.0'
gem 'ZenTest',     '~> 4.7.0'

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM