Open config/database.yml file and update it like the following: Gem install pg -with-pg-config=/Library/PostgreSQL/9.4/bin/pg_config Install the gem with pg-config path explicitly specified. By default, it should be /Library/PostgreSQL/9.4/bin/pg_config for PostgreSQL 9.4. If not, manually add a server pointing to localhost:5432 or the port number specified when installing PostgreSQL.įind out where pg_config is using the command below. The local DB should be already shown up in Obeject Browser -> Server Groups -> Servers -> PostgreSQL 9.4 (localhost:5432).Open up pgAdmin III from the applications.It helps users manage PostgreSQL databases through graphical interfaces. PgAdmin is the most popular and feature rich Open Source administration and development platform for PostgreSQL. bash_profile using the PostgreSQL's binary path. Open ~/.bash_profile with following command.Īdd the following line to. Otherwise, use the following find command to find the path. By default, it should be /Library/PostgreSQL/9.4/bin/psql, where 9.4 is the PostgreSQL version number. Installing Stack Builder is optional and can be omitted.Follow through the installation wizard with the default options.Install from the downloaded file postgresql-9.4.0-1-osx.dmg just like any other Mac installers.(For example, the latest installer version is Version 9.4.0). This grapichal installer provides an easy and straightforward wizard to get Postgres installed with few simple clicks. However, as I also use Linux and Windows machines for development, installing PostgreSQL using grapichal installer from EnterpriseDB would be a more widely used solution that keeps everything consistent across all my environment. Homebrew or Postgres.app are the common ones that often recommeded by other Mac users. Install PostgreSQLĪs shown in the official Postgres download instructions here, there are few ways of installing PostgreSQL on Mac OS. This note assumes that Ruby on Rails has already been properly installed and the purpose is to replace the default DB engine SQLite with PostgreSQL. usr/share/postgresql/Įgrep ‘listen|port’ /usr/local/Cellar/postgresql/9.0.4/share/postgresql/ brief note on how to install and setup PostgreSQL for Ruby on Rails on Mac OS. usr/local/Cellar/postgresql/9.0.4/share/postgresql/ > egrep ‘listen|port’ /usr/local/var/postgres/nfĮgrep: /usr/local/var/postgres/nf: No such file or directory Please log in (using, e.g., “su”) as the (unprivileged) user that will own the server process. Sudo pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start I found that there wasn’t any pg_hba.conf file (only file pg_), so I modified the sample and renamed it (to remover the. > pg_ctl -D /usr/local/var/postgres status Is the server running on host “localhost” and accepting TCP/IP connections on port 5432? The touch was not successful, so I did this instead:īut when I try to start the Ruby on Rails server, I still see this: Sh: /usr/local/var/postgres/server.log: No such file or directory > pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start I had forgotten to run the initdb command.
0 Comments
Leave a Reply. |