2012-11-09 79 views
1

我有一個Ruby IronWorker,它依賴於未發佈到RubyGems的私有gem。如何在IronWorker中捆綁本地gem依賴關係

有沒有辦法將本地mygemname-0.0.1.gem合併到我的IronWorker的.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文件得到這個工作?或者我應該考慮指定一個自定義構建步驟?

回答

2

據我所知,現在不支持git和本地路徑。 這裏有辦法手動包括當地的寶石: 這些行添加到.worker文件:

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

我已經添加下面展示瞭如何處理的情況下你的未發表的寶石有依賴關係的一些細節 –

3

如果您未發佈的創業板本身有依賴關係,你需要做一些按摩來得到的東西去。下面是對我的作品的技術:

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 
相關問題