Update Postgres.app instructions

- remove version number on git so we don't have to change it all the time
- update file path for postgresql.conf
- configure host for psql
- make the seed section its own section so its not embedded as a code snipppet
This commit is contained in:
Blake Erickson 2014-09-03 11:34:11 -06:00
parent 0b6c84e292
commit f71c8d4c72
1 changed files with 28 additions and 8 deletions

View File

@ -87,7 +87,7 @@ Either way, you'll now want to install the 'turbo' version of Ruby 2.0.
OS X comes with Git (which is why the LibXML2 dance above will work before this step!), but I recommend you update to Homebrew's version: OS X comes with Git (which is why the LibXML2 dance above will work before this step!), but I recommend you update to Homebrew's version:
brew install git # 1.8.5.3 is current brew install git
You should now be able to check out a clone of Discourse. You should now be able to check out a clone of Discourse.
@ -95,23 +95,23 @@ You should now be able to check out a clone of Discourse.
Atlassan has a free Git client for OS X called [SourceTree](http://www.sourcetreeapp.com/download/) which can be extremely useful for keeping visual track of what's going on in Git-land. While it's arguably not a full substitute for command-line git (especially if you know the command line well), it's extremely powerful for a GUI version-control client. Atlassan has a free Git client for OS X called [SourceTree](http://www.sourcetreeapp.com/download/) which can be extremely useful for keeping visual track of what's going on in Git-land. While it's arguably not a full substitute for command-line git (especially if you know the command line well), it's extremely powerful for a GUI version-control client.
## Postgres 9.2 ## Postgres 9.3
OS X ships with Postgres 9.1.5, but you're better off going with the latest from Homebrew or [Postgres.App](http://postgresapp.com). OS X ships with Postgres 9.1.5, but you're better off going with the latest from Homebrew or [Postgres.app](http://postgresapp.com).
### Using Postgres.app ### Using Postgres.app
After installing the [Postgres93 App](http://postgresapp.com/), there is some additional setup that is necessary for discourse to create a database on your machine. After installing [Postgres.app](http://postgresapp.com/), there are some additional setup steps that are necessary for discourse to create a database on your machine.
Open this file: Open this file:
``` ```
~/Library/Application Support/Postgres93/var/postgresql.conf ~/Library/Application Support/Postgres/var-9.3/postgresql.conf
``` ```
And change these two lines so that postgres will create a socket in the folder discourse expects it to: And change these two lines so that postgres will create a socket in the folder discourse expects it to:
``` ```
unix_socket_directories = '/var/pgsql_socket'»# comma-separated list of directories unix_socket_directories = '/var/pgsql_socket' # comma-separated list of directories
#and #and
unix_socket_permissions = 0777»·»·# begin with 0 to use octal notation unix_socket_permissions = 0777 # begin with 0 to use octal notation
``` ```
Then create the '/var/pgsql/' folder and set up the appropriate permission in your bash (this requires admin access) Then create the '/var/pgsql/' folder and set up the appropriate permission in your bash (this requires admin access)
``` ```
@ -125,6 +125,25 @@ netstat -ln | grep PGSQL
``` ```
And you should be good to go! And you should be good to go!
#### Troubleshooting
If you get this error when starting `psql` from the command line:
psql: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
It is because it is still looking in the `/temp` directory and not in `/var/pgsql_socket`.
If running `psql -h /var/pgsql_socket` works then you need to configure the host in your `.bash_profile`:
```
export PGHOST="/var/pgsql_socket"
````
Then make sure to reload your config with: `source ~/.bash_profile`. Now `psql` should work.
### Using Homebrew: ### Using Homebrew:
Whereas Ubuntu installs postgres with 'postgres' as the default superuser, Homebrew installs it with the user who installed it... but with 'postgres' as the default database. Go figure. Whereas Ubuntu installs postgres with 'postgres' as the default superuser, Homebrew installs it with the user who installed it... but with 'postgres' as the default database. Go figure.
@ -141,7 +160,8 @@ In theory, you're not setting up with vagrant, either, and shouldn't need a vagr
launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist launchctl load ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
# Seed data relies on both 'postgres' and 'vagrant' ### Seed data relies on both 'postgres' and 'vagrant'
createuser --createdb --superuser postgres createuser --createdb --superuser postgres
createuser --createdb --superuser vagrant createuser --createdb --superuser vagrant