Having trouble getting unicorn to run as a service. when I call "sudo service unicorn restart", I get the error below.
If I call '/var/www/mysite/bin/unicorn -D -c /var/www/mysite/config/unicorn.rb -E production' from the app's root directory, it runs just fine. And I can even call "sudo service unicorn restart" after that just fine.
Any help is much appreciated!
ubuntu@ip:$ sudo service unicorn restart
Couldn't reload, starting '/var/www/mysite/bin/unicorn -D -c /var/www/mysite/config/unicorn.rb -E production' instead
/usr/bin/env: ruby: No such file or directory
Here's the terminal output to show which ruby the system is using.
ubuntu@ip:$ which ruby
/home/ubuntu/.rbenv/shims/ruby
I'm running on Ubuntu 12.04. Rails 4, Ruby 2.1 and nginx