0

这是我的 Gemfile:

runtime 'ruby'
file 'Gemfile'
file 'config/database.yml', 'config/'                                                                                                                                         
file 'lib/models.rb', 'lib/'
remote_build_command 'bundle install --standalone'
exec 'my_worker.rb'

remote_build_commandbundle install --standalone安装了 gem,但它们似乎没有正确加载。

4

2 回答 2

1

根据文档,您现在可以在工作文件中指定一个 gemfile。当被问到这个问题时,我认为这不可用。

# example.worker

runtime "ruby"

gemfile "Gemfile"

file "lib/model.rb", "lib"

full_remote_build true

# You can also add gems individually if you don't want to use a separate file.
gem "pg"
gem "aws-sdk"

您无需指定 remote_build_command,而是指定full_remote_build true或只是remote让 IronWorker 为您设置环境。

于 2014-02-11T19:59:45.843 回答
0

bundle install --standalone将 gem 安装到bundle/bundler/setup目录。因此,在 的顶部my_worker.rb,添加以下行:

require_relative 'bundle/bundler/setup'

这应该加载你所有的宝石。

于 2012-08-03T21:24:02.393 回答