Ok got it working using the CentOS guild. Here is what differed from the guild and what i found unclear.
rails user needs to added to sudoers using visudo under
root ALL=(ALL) ALL
I added
rails ALL=(ALL) ALL
The following command fails because the latest activesupport requires Ruby version >= 2.2.2
gem install rails --no-ri --no-rdoc
Had to install v4.2.7 instead of the latest. I used:
gem install activesupport -v 4.2.7
gem install rails -v 4.2.7 --no-ri --no-rdoc
To clear up a question from earlier when you run
rake secret
The output needs to be put in /config/secrets.yml under production: secret_key_base:
The postgresql password needs to be edited in /config/database.yml under production: password:
The following command doesn't work
rails s -e production -b your.ip.add.ress:3000
It should be
rails s -e production -b your.ip.add.ress
The /etc/rc.d/init.d/nginx script has a typo, line 92 is Esac it should be esac
For /opt/nginx/conf/nginx.conf i did not replace the contents with what was provided as the versions differed, instead i just added the following under location
root /home/rails/helpy/public;
passenger_enabled on;
rails_env production;
I commented out the index index.html index.htm
I can provide my /opt/nginx/conf/nginx.conf and /etc/rc.d/init.d/nginx if needed. I could give you the whole vm if needed, i run it under hyper-v.
Also i needed to stop the firewall
service iptables stop