这是我的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'bundle install --standalone的remote_build_command会安装gem,但它们似乎无法正确加载。
发布于 2014-02-12 03:59:46
根据the documentation的说法,您现在可以在worker文件中指定一个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"您可以指定full_remote_build true,或者只指定remote来让IronWorker为您设置环境,而不是使用remote_build_command。
发布于 2012-08-04 05:24:02
bundle install --standalone将gem安装到bundle/bundler/setup目录。因此,在my_worker.rb的顶部,添加以下行:
require_relative 'bundle/bundler/setup'这应该会加载你所有的gem。
https://stackoverflow.com/questions/11803497
复制相似问题