I've been using Digital Ocean for alot of my web applications lately, simply because I find them to be easy to get up and online fast. I don't mind the additional system administrative tasks either, I find it quite fun.
When launching a One-Click Ubuntu 14.04 Image with Nginx and Unicorn for Ruby On Rails keep these things in mind:
tail -f /home/unicorn/log/unicorn.logis your friend, use it often to find issues you're having with gem installation. A proper unicorn log shouldn't constantly scroll errors about gems not being found.
- If you're using Rails 4.1 you probably want to check what version of Ruby RVM is using.
rvm listwill output the installed versions of Ruby on the system. To use Ruby 2.1.3 use this command
use rvm ruby-2.1.3
- Nginx may render you the dreaded 504 error messages. Check your unicorn logs first and debug any errors that might be there before looking elsewhere. Remember to
service unicorn restartoften after changes.
- If you continue to get 504 messages from Nginx look at how much RAM your VPS might be using via the
topcommand. I noticed the new image has 4 unicorn workers by default which was taking up a majority of my RAM when running into gem issues, changing this to 2 helped in the unicorn pid.