Problems with Unicorn with Rails 1 Click Installer
Hi everyone, after going through the simple install, I decided to remove the default rails application in the /home directory and attempted to have unicorn serve one of my own.
I did edit the unicorn.conf file in the /home directory to match the path of my new rails app (/home/blog instead of /home/rails). I also edited the nginx sites-enabled file to reflect the same directory under the root.
After restarting the droplet for good measure and navigating to the IP address of the droplet, I end up at the default nginx error message. I figured this is because unicorn isn’t up. So after entering the command “service unicorn start” I get the error message “ * Application directory /home/rails is not exist. Not starting.”
So after getting this message and verifying that unicorn is down, I’ll enter “service unicorn restart” which will yield an “OK” message. Entering “service unicorn status” does indeed confirm that it is running.
Now that both nginx and unicorn is running, and the config files are setup as expected, navigating to the droplet IP address will yield a blank page. I’m already weary of this since I had to restart unicorn which wasn’t even started in the first place.
What bothers me is that if I simply just navigate to the root of the rails app (/home/blog) and enter “unicorn” I can then navigate to the droplet’s IP address and have the app served to me without any problems.
Why in the world would the command “service unicorn start” refuse to start? I cannot find anything in /etc/init.d/unicorn that would help me understand. Also, is it okay to just enter “unicorn” in the root of the rails app and call it a day? I haven’t had any luck in finding a solution . If you’ve made it this far, thank you very much for your time!