简体   繁体   中英

Getting dependencies of git repo without .gemspec with bundler

I'm trying to install a git version of heckle using bundler.

At first I tried

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

But that didn't work, with

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'

I then specified the version of heckle, as per https://stackoverflow.com/a/3952045/38765 but bundler doesn't try installing any dependencies of heckle:

$ bundle exec heckle

gives me

cannot load such file -- ruby_parser (LoadError)

How do I tell bundler to find heckle's dependencies when there isn't a .gemspec?

You can't. How would bundler know the dependencies when .gemspec is where the dependencies are supposed to be found.

If you look at the heckle Rakefile you will see:

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

You just have to add those manually to your Gemfile :

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM