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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T22:02:13+00:00 2026-06-05T22:02:13+00:00

I currently have Ruby on Rails installed via RVM in Ubuntu 12.04. The default

  • 0

I currently have Ruby on Rails installed via RVM in Ubuntu 12.04. The default database is set up in SQLite3, but I’d like to switch to PostgreSQL for the purposes of pushing to Heroku. How can I accomplish this?

  • 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-05T22:02:16+00:00Added an answer on June 5, 2026 at 10:02 pm

    Here are the steps I’ve followed:

    Install PostgreSQL and development package

    $ sudo apt-get install postgresql
    $ sudo apt-get install libpq-dev
    

    Set up a user that is the same as my Ubuntu log-in

    $ sudo su postgres -c psql
    postgres=# CREATE ROLE <username> SUPERUSER LOGIN;
    postgres=# \q
    

    Modify Gemfile

    # Remove gem 'sqlite3'
    gem 'pg'
    

    Modify database.yml in app directory

    development:
      adapter: postgresql
      encoding: unicode
      database: appname_development
      pool: 5
      timeout: 5000
      username: <username>
      password:
    
    test:
      adapter: postgresql
      encoding: unicode
      database: appname_test
      pool: 5
      timeout: 5000
      username: <username>
      password:
    

    Run bundle install

    $ bundle install
    

    Create databases and migrations

    $ rake db:create:all
    $ rake db:migrate
    

    Here are the sources I used to help:
    http://mrfrosti.com/2011/11/postgresql-for-ruby-on-rails-on-ubuntu/
    http://railscasts.com/episodes/342-migrating-to-postgresql
    https://devcenter.heroku.com/articles/local-postgresql

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

Sidebar

Related Questions

I have installed ruby via rvm on Mint 11 no problem. Installed gems, ditto.
I've installed Ruby (1.8.7 via apt-get) and I installed Rails (2.3.2 via rubygems) but
I currently have a Ruby on Rails system, and there are plans to port
Hello Ruby/Rails/Merb developers! Im currently working on a web project that will have a
Currently I have Ruby 1.8.7 and Rails 2.3.8. Is it possible to update ruby
I have just installed paperclip into my ruby on rails blog application. Everything is
I have standard ruby-head and Rails 3.1rc4. I installed ruby-debug with following instructions from
I have a fresh install of Ubuntu Karmic, Ruby and Rails. I checkout out
I have currently moved to a appplication on rails 2.3.4 and ruby 1.8.7 using
I've recently installed Ruby on Rails 3.2 and have been trying to learn it.

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.