title: Using Sidekiq to run more complex jobs
body: <p>edit: It was actually really simple, I forgot to pass in <code>site</code> and <code>token</code></p>
  
  <p>I have setup Sidekiq and Redis on Heroku and I am able to get it to work with very simple jobs like this:</p>
  
  <p><strong>order_worker.rb</strong></p>
  
  <pre><code>class OrderWorker
      include Sidekiq::Worker
      sidekiq_options retry: false
  
      def perform(num_orders)
        x=3*5
      end
  end
  </code></pre>
  
  <p>But more complex jobs keep failing according to the Sidekiq web ui. Do I need to include ShopifyAPI and Faker somehow? I'm not super clear on what is being run. Is the entire app, with gems and all being created in a worker dyno?</p>
  
  <p><strong>order_worker.rb</strong></p>
  
  <pre><code>class OrderWorker
      include Sidekiq::Worker
      sidekiq_options retry: false
  
      def perform(num_orders)
          include ShopifyAPI
          include Faker
  
          # Initialize session
          session = ShopifyAPI::Session.new(site, token)
          ShopifyAPI::Base.activate_session(session)  
  
          #Create orders
          num_orders.times do
              new_order = ShopifyAPI::Order.new(
                :line_items =&gt; [
                  ShopifyAPI::LineItem.new(
                    :quantity =&gt; 1,
                    :variant_id =&gt; 25701798472
                  )
                ]
              )
              new_order.billing_address = ShopifyAPI::BillingAddress.new(:name =&gt; Faker::Name.name, :zip =&gt; zips[rnd], :country =&gt; 'United States', :province =&gt; states[rnd], :address1 =&gt; Faker::Address.street_address, :city =&gt; Faker::Address.city)
              new_order.email = r.rand(36**2).to_s(36) + '@yahoo.com'
              new_order.created_at = Faker::Time.backward(390, :evening)
              new_order.total_price = Faker::Number.decimal(3, 2)
              new_order.save
              @errs = @errs + new_order.errors.full_messages
              sleep 0.03
          end
  
      end
  
  
  end
  </code></pre>