Following the instructions here: https://www.digitalocean.com/community/articles/how-to-deploy-rails-apps-using-passenger-with-nginx-on-centos-6-5
I get to the point of "Use vim /etc/init.d/nginx to create the start/restart/stop script for nginx" but I can't get the server to start after creating this file and giving it permission to execute. I just get the error env: /etc/init.d/nginx: No such file or directory
but I can clearly see that the file is where it is supposed to be.
When I try to start nginx directly using /etc/init.d/nginx start
I get the error -bash: /etc/init.d/nginx: /bin/sh^M: bad interpreter: No such file or directory
.
What could be causing this?