INSTALL rails, do not install MySQL or PostgresSQL as suggested on that page. its easier through the terminal gorails.com/setup/windows/10
UPDATE: As of 1/25/2020, I did not need this step. this is a needed fix for the above install steps https://stackoverflow.com/questions/50085258/installing-ruby-2-3-x-on-ubuntu-18-04-is-causing-an-error-by-the-end-of-the-inst sudo apt purge libssl-dev && sudo apt install libssl1.0-dev
this fixes a problem installing gem pg stackoverflow.com/questions/13086073/rails-install-pg-cant-find-the-libpq-fe-h-header sudo apt-get install libpq-dev
INSTALL heroku cli devcenter.heroku.com/articles/heroku-cli this is the given command, but at this time (Jan 2020) it is not supported in WSL sudo snap install –classic heroku superuser.com/questions/1391219/setting-up-heroku-cli-in-wsl curl cli-assets.heroku.com/install.sh | sh
INSTALL PostgresSQL tecadmin.net/install-postgresql-server-on-ubuntu/ stackoverflow.com/questions/46312111/windows-linux-subsystem-and-postgresql-connection-failed
sudo apt-get install wget ca-certificates wget –quiet -O - www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add - sudo sh -c ‘echo “deb apt.postgresql.org/pub/repos/apt/ `lsb_release -cs`-pgdg main” >> /etc/apt/sources.list.d/pgdg.list’ sudo apt-get update sudo apt-get install postgresql postgresql-contrib
sudo service postgresql start sudo -i -u postgres psql password postgres tricks tricks rake db:create rake db:migrate
If db:create is failing to yarn issues:
-
Install yarn:
curl --compressed -o- -L https://yarnpkg.com/install.sh | bash
-
veryfiy correct version (1.21.1 as of 1/25/2020):
yarn --version
-
you might need to restart here if the next command is not working
-
yarn install
to pull the live database down PGUSER=postgres PGPASSWORD=tricks PGHOST=localhost dropdb tricks_development PGUSER=postgres PGPASSWORD=tricks PGHOST=localhost heroku pg:pull DATABASE_URL tricks_development –app tricks-app
to copy live database to stage heroku pg:copy tricks-app::DATABASE_URL DATABASE_URL –app tricks-stage
Tips: When using WSL line endings can get messed up, this causes heroku to crash after building the site If committing from WSL make sure to use this git config for line endings
git config --global core.autocrlf input
removes a hook that was preventing sudo apt install sudo rm -rf /etc/apt/apt.conf.d/20snapd.conf
program to convert line endings sudo apt install dos2unix
convert all line endings find ./ -type f -exec dos2unix {} ;