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 8265713
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T04:54:05+00:00 2026-06-08T04:54:05+00:00

I have a web application which uses SQLite. I deploy it on heroku which

  • 0

I have a web application which uses SQLite. I deploy it on heroku which uses PostgreSLQ. This causes problems sometimes and I was advised to develop my app using PostgreSQL instead of SQLite.

I found out that I should modify database.yml like that (same for test and production):

development:
  adapter: postgresql
  database: my_database
  username: my_username
  password: my_passwod
  host: /var/run/postgresql or localhost

Well the only database I’ve ever used is SQLite, so I just tried to take my chances, but failed. I filled this file with some random data.

rake db:migrate resulted in:

When I used host: localhost

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

When host: /var/run/postgresql

> could not connect to server: No such file or directory 
> Is the server running locally and accepting connections on Unix domain socket
> "/var/run/postgresql/.s.PGSQL.5432"?

I suppose I should start PostgreSQL server first, but have no idea how to do this. Please give me a step by step answer how to move from a SQLite application to a working PostgreSQL application.

  • 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-08T04:54:06+00:00Added an answer on June 8, 2026 at 4:54 am

    I would like to advise to you that you should download Postgresql including the PGADMIN itself which is easier to use than the psql terminal.

    And I think when you download/install Postgresql from their official website… the package was complete already.

    Upon installing, the postgresql will ask you a certain password that you will be using in accessing your postgresql server.

    After the installation, open the PGADMIN and connect to the server. Enter your password (which you had declared during installation).

    If you can’t connect to the server, then edit the port. To do this, right click the server then go to properties… edit the port into something which is free. Example: 5433 and so on. It’s up to you.

    If everything’s finally working… setup the correct config for your database.yml

    This is important:

    development:
      adapter: postgresql
      database: name_of_database_here
      host: localhost
      username: postgres
      password: your_db_server_password_here
      pool: 5
      timeout: 5000
      port: 5433
    

    Okay from that config info above, specify the important parts. By default, your db server username is postgres and obviously your host is localhost because you are setting up under the development.

    If your port is 5432 by default then just remove the port part.

    Let’s go to your gemfile.

    In order for you to deploy your app in heroku. Use gem ‘pg’ instead of sqlite3.

    If you have an existing sqlite3 database then put the gem inside the development group. In that case, Heroku will successfully bundle during git push heroku master process.

    group :development do
           gem 'sqlite3'
    end
    

    Your gem 'pg' can either go outside the groups or put it in your production group.

    Important:

    Before any deployment procedure, make sure that you can run the app locally (localhost). Then if everything’s working… that’s the time that you should organize the necessary stuffs appropriately.

    If you wish to switch to Postgresql instead of sqlite3 after pushing the app to Heroku… you can do so by pgbackups add-on and pg_restore the dump file into your local postgresql db server.

    That’s it. Hope it helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a web application that uses a library which resides in TOMCAT_HOME/common/lib. This
I have a web application which uses URLs that look like this: http://library.example.com/Register.aspx?query=academic&key=586c70bb-5683-419c-aae9-e596af9ab66a (The
I have this .NET web forms application which uses SQl server database, It runs
I have an ASP .NET web application which uses Forms Authentication. Let's call this
I have a web application which uses the globalization values being passed from sql
Suppose I have a web application, which uses jQuery for Ajax and UI. Now
I have a currency converter application for iphone which uses web service. The web
I have a web-application which uses hibernate and for some reason every thread (httprequest
I have a web application which uses membership and profiles. I successfully used the
I have a web application code which uses jsp, servlet and ejb. I created

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.