koopjs / koop-app-example

A Koop express application example with some common providers.
Other
25 stars 35 forks source link

Can't get past NPM Install #28

Closed Clenera closed 9 years ago

Clenera commented 9 years ago

Trying to get the sample app configured and running. I've been following the instructions and have cloned the app, cd into the directory, npm install, then I try to follow the instructions for creating a koopdev PostgreSQL database and enable PostGIS but it doesn't work.

I'm in the koop-sample-app directory and type "createdb koopdev" and it give the following error:

Kevins-MacBook-Pro-2:koop-sample-app kevinmeasom$ createdb koopdev -bash: createdb: command not found

What am I doing wrong?

jgravois commented 9 years ago

a couple possibilities:

  1. postgres isn't installed on your computer
  2. your shell PATH doesn't link to the appropriate command
  3. you aren't typing in su postgres first.

see this stack overflow thread for more info. im not a command line nut myself, so i typically install pgAdmin and create databases, add the PostGIS extension and do other administrative tasks from there.

Clenera commented 9 years ago

I'm pretty sure it's the path but I tried using "sudo su postgres createdb koopdev" and entered my password which returned: "su: unknown login: postgres".

I then tried the psql koopdev with a combination of sudo, su, sudo su, postgres, etc.

everything that I would type in returned the same thing. I also downloaded the pgAdmin but don't know how to use it and have tried adding a database according to their documentation but can't get it to work.

jgravois commented 9 years ago

pretty sure its a two liner:

$ sudo postgres
Password:
$ createdb koopdev

i googled 'how to create database pgadmin' and found this.

Clenera commented 9 years ago

I uninstalled the pgAdmin stuff as I couldn't get things to work and installed Postgres.app which got me working through the database setup.

ungoldman commented 9 years ago

@Clenera glad it worked :+1:

I use homebrew to install postgres on my macbook, and was able to get it working with that. A couple extra steps are needed after installing using that workflow -- one to initialize the database if it's your first time, and another to add postgres to your system's launch agents so it gets automatically started when you restart your computer. I found these instructions to be pretty reliable:

http://www.moncefbelyamani.com/how-to-install-postgresql-on-a-mac-with-homebrew-and-lunchy/

I'm glad Postgres.app worked out of the box. Hopefully the above advice can be useful to others in the future.

jgravois commented 9 years ago

cheat commandos, rock rock on! cheat commandos