Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8360069
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T11:20:56+00:00 2026-06-09T11:20:56+00:00

I am pretty new to RoR and I am looking to deploy my next

  • 0

I am pretty new to RoR and I am looking to deploy my next app to heroku. I want my development & test environment to match my production environment for the smoothest transition. As such, I went about installing postgresql on my system. This process has been more than frustrating and I am beyond confused. I followed countless tutorials to no avail and it seems like many have conflicting information. Here is what I know:

There are many ways to install postgresql. Common options are macports, homebrew, fink, Postgresql.app, or enterpriseDB. Once you install one of the previous, you have to create your rails app and either run:

rails new <app_name> -d postgresql

or run the standard ‘rails new ‘ and then change ‘sqlite3’ to ‘pg’ in your gemfile. Then, if I am correct, you actually have to create your own database in the command-line by doing this:

$ psql
$ CREATE DATABASE your_database_name;

Then, edit your database.yml to follow something close to this:

development:
  adapter: postgresql
  encoding: unicode
  database: <your_database_name>
  host: localhost
  pool: 5
  username: <username>
  password:

Once that is done, all should be well. However, I am having problems. I actually have it working using the above process, but I am confused as to how it is running. During hours of trying to get all this to work, I installed the macports, homebrew, and postgresql.app. However, whenever I try to interact with the database (such as a ‘rake db:migrate’) without postgresql.app running, I get this error:

could not connect to server: Connection refused
    Is the server running on host "localhost" (::1) and accepting
    TCP/IP connections on port 5432?
could not connect to server: Connection refused
    Is the server running on host "localhost" (127.0.0.1) and accepting
    TCP/IP connections on port 5432?
could not connect to server: Connection refused
    Is the server running on host "localhost" (fe80::1) and accepting
    TCP/IP connections on port 5432?

If I fire it back up, everything is fine. Ok, so that leads me to assume my system is using postgresql.app to run postresql. With that information, I confidently uninstall macports and hombrew installations of postgresql. However, upon doing so, I get this error when trying to interact with the database:

Library not loaded: /usr/local/lib/libpq.5.4.dylib (LoadError)

I reinstall macports and still get the same error. Then I reinstall homebrew and the error goes away. I then uninstall macports again and all is still fine. It appears that postgresql.app and my homebrew installation are somehow dependent upon each other. If I am correct, they should be able to run independently of each other because each is a full install of postgreql. I am pretty much out of ideas at this point. Any and all input on how this process is done what what is going on would be VERY APPRECIATED.

EDIT

$ which psql

shows:

/usr/local/bin/psql

and

ls -l /usr/local/bin/psql

shows:

lrwxr-xr-x  1 robertquinn  admin  35 Jul 29 17:32 /usr/local/bin/psql -> ../Cellar/postgresql/9.1.4/bin/psql 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T11:20:57+00:00Added an answer on June 9, 2026 at 11:20 am

    Homebrew is definitely the way to go. After years of using Macports, I find Homebrew much easier to use, upgrade and maintain.

    If you are new to Homebrew, sometimes when you install something, there will be output printed at the end of the install which gives you additional tasks. Sometimes the install asks you to manually create new links, sometimes it asks you to redo links with the new cellar-located executables. Make sure you read that output and follow those after-install instructions.

    Once those instructions are followed, open a new terminal window to make sure your settings are respected.

    Also, if you use rails new app_name -D postgresql, your database.yml file should already be configured correctly, unless of course you’ve configured your postgres instance to use a username and password.

    To make starting and stopping postgres easier, i added these commands to my .profile file

    # postgres
    alias pg_start="pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start"
    alias pg_stop="pg_ctl -D /usr/local/var/postgres stop -s -m fast"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm pretty new to ROR. I've recently deployed an app on heroku and have
I'm pretty new to Eclipse plugins and I want to create a VerticalRuler, I
I am pretty new to Wordpress . I want to know how to define
I'm pretty new on RoR, and I having a hard time to figure out
I'm pretty new to RoR programming. I remember reading on some tutorial (forgot which)
Pretty new to Qt and I ran into this behavior in an app I
Am pretty new to ROR. Need help in Rails form validation. Am using rails
I'm brand new to RoR and have pretty much 0 experience with it. I
Pretty new to Java and also to Mac ... I want to make sure
Pretty new to this kind of development. Wondering if anyone can point me in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.