1

RubyGemsに公開されていないプライベートgemに依存するRubyIronWorkerがあります。

このローカル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ファイルを介してこれを機能させようとしているのは正しい方向に進んでいますか?または、カスタムビルドステップの指定を検討する必要がありますか?

4

2 に答える 2

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
于 2012-11-12T07:44:45.537 に答える
2

私の知る限り、gitとローカルパスは現在サポートされていません。ローカルgemを手動で含める方法は次のとおりです。次の行を.workerファイルに追加します。

dir '../vendor/bundle/mygemname', '__gems__/gems'
file '../vendor/bundle/mygemname/mygemname.gemspec', '__gems__/specifications'
于 2012-11-09T15:51:06.377 に答える