Reputation: 41083
Here is my 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'
The remote_build_command, bundle install --standalone
installs the gems, but they don't seem to load properly.
Upvotes: 0
Views: 596
Reputation: 1138
According to the documentation, you can now specify a gemfile in your worker file. I don't think this was available when this question was asked.
# 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"
Instead of having a remote_build_command, you specify full_remote_build true
, or just remote
to have IronWorker set up your environment for you.
Upvotes: 1
Reputation: 41083
bundle install --standalone
installs the gems to bundle/bundler/setup
directory. So at the top of my_worker.rb
, add the following line:
require_relative 'bundle/bundler/setup'
This should load up all your gems.
Upvotes: 0