- Use below Vagrantfile, this will install a Ubuntu 16.04 box and update the server and install git and the build-essential packages.
Vagrant.configure("2") do |config|
config.vm.box = "bento/ubuntu-16.04"
config.vm.network "forwarded_port", guest: 80, host: 10301
config.vm.network "private_network", ip: "192.168.33.10"
config.vm.provision "shell", inline: <<-SHELL
apt-get update
apt-get install git build-essential
SHELL
end
- Run vagrant up command to setup box and then vagrant ssh to ssh to the box
- Run
wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.33.2/install.sh | bash
to get latest version of nvm
- Run
nvm ls-remote | grep 0.10.*
and install the latest version of 0.10.x.
- Run
nvm use 0.10.x
to use the latest version of node
- Install Npm by running
npm -g install npm@latest-2
- Install PostgreSQL 9.4 by following the instructions in the top answer here: https://askubuntu.com/questions/765539/how-to-install-postgresql-9-4-on-ubuntu-16-04
- Update password for postgres user by going here: http://suite.opengeo.org/docs/latest/dataadmin/pgGettingStarted/firstconnect.html and looking at the "Setting a password for the postgres user" section
- While still in the postgres command line, run this command
create user platform with superuser password 'QdYx3D5y';
- Under the vagrant user, create a folder called Project within the root (
mkdir /home/vagrant/Project
).
- Within the project folder, run
git clone https://github.com/CoderDojo/cp-local-development.git && cd cp-local-development
- Within the repo, change
.nvmrc
to use the latest v0.10.x you installed in step 4
- Run
nvm use
and npm install
in the repo
- If no failures, run
./localdev.js init zen
- You will get an error saying "ChromeDriver installation failed [TypeError: Object # has no method 'isAbsolute']", this is fixed by installing Node v5.6 and above
- What you have to do now is run
nvm ls-remote | grep 5.*
and see the latest version of 5.x
- Run
nvm install 5.x
- Run
nvm use 5.x
- In the
.nvmrc
file in the cp-local-development repo, update it to use v5.x
- Run
nvm use
within the cp-local-development repo to update to v5.x
- Run
./localdev.js init zen
again, you should get no errors
- Run
./localdev.js run zen
, you should get no errors.
- Go to http://192.168.33.10:8000 in your browser locally and the page should load.