Skip to content

Conversation

@ethomas2
Copy link

No description provided.

@ethomas2 ethomas2 changed the title Update Readme with more recent local development instructions Update local development instructions in README Sep 18, 2018
@zingales
Copy link
Collaborator

Did you install this on linux or on macOS? Also i think the create database isn't correct. Also the environment variables are saved in .env which is loaded by heroku local command.

* heroku cli installed
* `brew install heroku`
* `brew install postgres`
* `pg_ctl start -D /usr/local/var/postgres`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did the previous version not work on your machine?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nope

mbp-IT002597:~ ethomas$ pg_ctl --version
pg_ctl (PostgreSQL) 10.3
mbp-IT002597:~ ethomas$ pg_ctl --help | head -10
pg_ctl is a utility to initialize, start, stop, or control a PostgreSQL server.

Usage:
  pg_ctl init[db] [-D DATADIR] [-s] [-o OPTIONS]
  pg_ctl start    [-D DATADIR] [-l FILENAME] [-W] [-t SECS] [-s]
                  [-o OPTIONS] [-p PATH] [-c]
  pg_ctl stop     [-D DATADIR] [-m SHUTDOWN-MODE] [-W] [-t SECS] [-s]
  pg_ctl restart  [-D DATADIR] [-m SHUTDOWN-MODE] [-W] [-t SECS] [-s]
                  [-o OPTIONS] [-c]
  pg_ctl reload   [-D DATADIR] [-s]

I tried checking the pg_ctl release notes to see if something changed. Couldn't find anything. But putting the optional args before start resulted in an error for me

* create database
* `psql -d postgres -c "create database cerealnotes_test"`
* Refer to `migrations/README.md` to create relevant database tables
* export environment variables
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you used heroku local you wouldn't need to do this

export PORT=8000
```
* run the app
* `go build && ./cerealnotes`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why this instead of go install && heroku local?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just to avoid heroku

* `go build && ./cerealnotes`

## Heroku
* heroku cli installed
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this needs to be installed to run locally

@ethomas2
Copy link
Author

ethomas2 commented Sep 18, 2018

  • installed on macos.

  • I just made the sepereate db because I found it cleaner. I usually keep a database per project/app. So I made a db specifically for cerealnotes so as not to clutter the default db with cerealnotes specific tables.

  • I didn't notice .env. You're right that I would've saved a lot of time if I just used heroku local like the README told me to. I'm having trouble finding reasons why I was averse to using heroku local. G and I chatted offline about this, he told me to use heroku local to minimize the differences between local development and prod. Makes sense

@ethomas2
Copy link
Author

closing in favor of #39

@ethomas2 ethomas2 closed this Sep 18, 2018
@ethomas2 ethomas2 deleted the update-readme branch September 18, 2018 17:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants