title: Run rails sidekiq as a system service on ubuntu 16.04
body: <p>I have system requirement below:</p>
  
  <ol>
  <li><code>Ubuntu 16.04</code></li>
  <li><code>ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-linux]</code></li>
  <li><code>Rails 4.2.5</code></li>
  </ol>
  
  <p>i can run command <code>bundle exec sidekiq -q queue</code> inside my project without error. Unfortunately when i try to create system service with following filename single_profile_crawl_worker.service:</p>
  
  <pre><code>[Unit]
  Description=sidekiq
  
  [Service]
  WorkingDirectory=/home/jaisanas/Documents/work/myproject
  ExecStart=/home/jaisanas/.rvm/gems/ruby-2.2.1@scraper/bin/bundle exec sidekiq -q tahilalat
  
  [Install]
  WantedBy=multi-user.target
  </code></pre>
  
  <p>then i run command:</p>
  
  <blockquote>
    <p>sudo systemctl start single_profile_crawl_worker.service</p>
  </blockquote>
  
  <p>then when i check the service status, by following command:</p>
  
  <blockquote>
    <p>sudo systemctl status single_profile_crawl_worker.service</p>
  </blockquote>
  
  <p>it returns error like below:</p>
  
  <pre><code>single_profile_crawl_worker.service - sidekiq
   Loaded: loaded (/etc/systemd/system/single_profile_crawl_worker.service; disabled; vendor preset: enabled)
         Active: failed (Result: exit-code) since Kam 2018-08-09 14:13:43 WIB; 5s ago
        Process: 9822 ExecStart=/home/jaisanas/.rvm/gems/ruby-2.2.1@scraper/bin/bundle exec sidekiq -q tahilalat (code=exited, status=127)
       Main PID: 9822 (code=exited, status=127)
  
      Agu 09 14:13:43 jaisanas-X456URK systemd[1]: Started sidekiq.
      Agu 09 14:13:43 jaisanas-X456URK bundle[9822]: /usr/bin/env: ‘ruby_executable_hooks’: No such file or directory
      Agu 09 14:13:43 jaisanas-X456URK systemd[1]: single_profile_crawl_worker.service: Main process exited, code=exited, status=127/n/a
      Agu 09 14:13:43 jaisanas-X456URK systemd[1]: single_profile_crawl_worker.service: Unit entered failed state.
      Agu 09 14:13:43 jaisanas-X456URK systemd[1]: single_profile_crawl_worker.service: Failed with result 'exit-code'.
  </code></pre>
  
  <p>it said <code>/usr/bin/env: ‘ruby_executable_hooks’: No such file or directory</code>. Then i've tried several solution like installing ruby_executable_hooks by running <code>sudo gem install --user-install executable-hooks</code> it doesn't work, anyone know what's wrong with my steps create this sidekiq system service ?</p>