如何将铁工中的本地宝石依赖性捆绑在一起



我有一个红宝石铁工,依赖于私人宝石,该宝石未发布给RubyGems。

有没有办法将此本地的mygemname-0.0.1.gem合并到我的 .worker文件中的铁工?

我希望能够在myruby.worker中指定以下内容:

gem 'mygemname', '>=0.0.1', :path=> 'vendor/bundle'

当前这给出以下错误

.rvm/gems/ruby-1.9.3-p0/gems/iron_worker_ng-0.12.2/lib/iron_worker_ng/code/base.rb:79 :in `eval':
   wrong number of arguments (3 for 2) (ArgumentError)

希望默认值给予:

 gem 'mygemname', '>=0.0.1'

给出以下错误

Could not find gem 'mygemname (>= 0.0.1) ruby' in the gems available on this machine. 

我是否在正确的轨道上试图通过.worker文件使其工作?还是我应该研究指定自定义构建步骤?

如果您未发表的宝石本身具有依赖关系,则需要进行一些按摩才能使事情变得持续。这是一种对我有用的技术:

mygem.worker

runtime "ruby"
#Merge in an unpublished local gem
dir '../opensource-cli-tools/facebook_exporter', '__gems__/gems'
file '../opensource-cli-tools/facebook_exporter/mygem.gemspec', '__gems__/specifications'
#Merge in a custom build script to fetch the unpublished gem's dependancies
file "Gemfile"
file "install_dependancies.sh"
remote_build_command 'chmod +x install_dependancies.sh && ./install_dependancies.sh'
#Run the puppy!
exec "run.rb"

install_dependancies.sh

echo "Installing dependancies to __gems__/"
gem install bundler --install-dir ./__gems__ --no-ri --no-rdoc
bundle install --standalone --path ./__gems__
cp -R ./__gems__/ruby/*/* ./__gems__
rm -rf ./__gems__/ruby
echo "Fixing install location of mygem"
mv ./__gems__/gems/mygem ./__gems__/gems/mygem-0.0.1

据我所知,git和本地路径现在不支持。这是手动包括本地宝石的方法:将这些行添加到.worker文件:

dir '../vendor/bundle/mygemname', '__gems__/gems'
file '../vendor/bundle/mygemname/mygemname.gemspec', '__gems__/specifications'

相关内容

  • 没有找到相关文章

最新更新