Setting up a new rails app with Codeanywhere
-
Create a new container - select the type (ruby in this case)
-
Connecting a Github Repo
-
cd ~/.ssh cat id_rsa.pub
-
Add this to your Github Profile on github.com as an authorized key
-
Now add the remote
-
cd ~/workspace git init git remote add github REPO_URL git pull github master
-
Setting up postgres
-
Default apt-get postgres that gets installed is 9.5. Use 13 instead by following instructions here: https://www.postgresql.org/download/linux/ubuntu/
-
I had an issue with this on one stack, where I had to change the line:
-
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
-
to the below in order to get it to work
-
wget -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc --no-check-certificate | sudo apt-key add -
-
Once installed, the default user will need to be set up:
-
sudo -u postgres createuser -s $(whoami)
-
Installing Gems
-
Had to install some additional dependencies for the repo I was working with - may or may not be necessary depending on codebase.
-
sudo apt-get install shared-mime-info sudo apt-get install libpq-dev
-
Setting up the Heroku CLI
-
Goal here is to be able to quickly get a copy of the prod database on command.
-
curl https://cli-assets.heroku.com/install-ubuntu.sh | sh heroku login -i
-
Restoring an heroku backup
-
pg_restore --verbose --clean --no-acl --no-owner -d countries latest.dump
-