contribsys / faktory_worker_ruby

Faktory worker for Ruby
GNU Lesser General Public License v3.0
214 stars 31 forks source link

Docker Ruby does not auto-load `digest` module, required by production #24

Closed ttilberg closed 6 years ago

ttilberg commented 6 years ago

Using Docker(ruby:2.4, ruby:2.5), the Digest module is not included and raises exception when trying to connect a client against a production Faktory. This does not happen in the development config, as it doesn't require a password.

rubyworker1_1  | 5 TID-gquxjs6bg INFO: Running in ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-linux]
rubyworker1_1  | 5 TID-gquxjs6bg INFO: See LICENSE and the LGPL-3.0 for licensing details.
rubyworker1_1  | 5 TID-gquxll27o ERROR: Error fetching job: uninitialized constant Faktory::Client::Digest
rubyworker1_1  | 5 TID-gquxll27o ERROR: /usr/local/bundle/gems/faktory_worker_ruby-0.7.1/lib/faktory/client.rb:14:in `block in <class:Client>'
rubyworker1_1  | 5 TID-gquxll27o ERROR: /usr/local/bundle/gems/faktory_worker_ruby-0.7.1/lib/faktory/client.rb:174:in `open'

Reproduction:

Save this docker-compose.yml file and execute it with docker-compose up

version: '3'
services:
  faktory:
    image: contribsys/faktory
    environment:
      - FAKTORY_PASSWORD=password
    command: /faktory -b 0.0.0.0:7419 -e production

  example:
    image: ruby:2.5
    depends_on: [faktory]
    environment:
      - FAKTORY_URL=tcp://:password@faktory:7419
    command: bash -c "gem install faktory_worker_ruby && ruby -r faktory_worker_ruby -e Faktory::Client.new"