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
  • Add this to your Github Profile on 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:

  • I had an issue with this on one stack, where I had to change the line:

  • wget --quiet -O - | sudo apt-key add -
  • to the below in order to get it to work

  • wget -O - --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 | sh
    heroku login -i
  • Restoring an heroku backup

  • pg_restore --verbose --clean --no-acl --no-owner -d countries latest.dump

  • Website Page