From waheedi, 2 Years ago, written in Plain Text.
  1. I'm trying to start unicorn ruby gem using service unicorn start so I have below my unicorn.conf file
  2.  
  3. description "Unicorn"
  4.  
  5. start on (filesystem and net-device-up IFACE=lo)
  6. stop on runlevel [!2345]
  7.  
  8. env PATH=/opt/ruby-1.9.3-p125/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/usr/local/ruby/bin:/sbin
  9.  
  10. #env user=www-data
  11. #export user
  12.  
  13. chdir /var/www/app/
  14.  
  15.  
  16. respawn
  17. respawn limit 10 5
  18.  
  19. #pre-start script
  20. script
  21.         su www-data -c "cd /var/www/app/ && bundle exec unicorn -c /var/www/app/config/unicorn.rb -E production"
  22. end script
  23.  
  24. post-stop exec kill `cat /var/www/app/pids/unicorn.pid`
  25.  
  26.  
  27. Now if i su as www-data and then run cd /var/www/app/ && bundle exec unicorn -c /var/www/app/config/unicorn.rb -E production
  28.  
  29. the unicorn starts as expected and no problems! but when i start it with sudo service unicorn start I get the below error:
  30.  
  31. bundler: command not found: unicorn
  32. Install missing gem executables with `bundle install`
  33.  
  34.  
  35.  
captcha