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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T15:49:43+00:00 2026-06-02T15:49:43+00:00

I am learning rails and when I started and installed everything I went with

  • 0

I am learning rails and when I started and installed everything I went with sqlite3 based on the books that I was reading. However, I was trying to deploy a test app that I wrote on heroku. Heroku recemmends that the apps run postgresql for development and production to prevent subtle bugs. So I decided to henceforth use post gresql for all my rails apps.

To do this I did the following set up:
1) Downloaded and installed Postgresql
2) added the path to the folder in my .bash_rc file
3) installed the pg gem
4) Everything so far was good. However, when I go to the root folder of my app and try this command:

rails generate scaffold User name:string email:string

I get the following error on the console

rails generate scaffold User name:string email:string

invoke  active_record 
/Users/AM/.rvm/gems/ruby-1.9.2-p290/gems/bundler-
1.0.22/lib/bundler/rubygems_integration.rb:143:in `block in replace_gem': 
Please install the sqlite3 adapter: `gem install activerecord-sqlite3-adapter` 
(sqlite3   is not part of the bundle. Add it to Gemfile.) (LoadError)
from /Users/AM/.rvm/gems/ruby-1.9.2-p290/gems/activerecord- 
3.2.1/lib/active_record/connection_adapters/sqlite3_adapter.rb:3:in `<top (required)>'

This tells me that the default setting in my rails app is for sqlite3 clearly. So I opened my databse.yml file and this si what it had.

# SQLite version 3.x
#   gem install sqlite3
#
#   Ensure the SQLite 3 gem is defined in your Gemfile
#   gem 'sqlite3'
development:
  adapter: sqlite3
  database: db/development.sqlite3
  pool: 5
  timeout: 5000

# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test:
  adapter: sqlite3
  database: db/test.sqlite3
  pool: 5
  timeout: 5000

production:
  adapter: sqlite3
  database: db/production.sqlite3
  pool: 5
  timeout: 5000

Everything was set up for sqlite3
How can I change my rails settings such that by default all the configs for database are for postgresql?

Thanks

  • 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-02T15:49:47+00:00Added an answer on June 2, 2026 at 3:49 pm

    Update: Check out – http://railscasts.com/episodes/342-migrating-to-postgresql

    You just need to change the settings in your database.yml file so it knows what you want to use. In your case you’ll want to change the adapter and database:

    development:
      adapter: postgresql
      database: my_app_dev
      username: username
      password: pw
    

    Once you’ve got that in there, you can run the following to get it to match what you had in sqlite:

    rake db:create && rake db:schema:load
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Recently I have started learning rails and was a little surprised that the default
Just started learning Rails (3). I am tearing my hair out trying to find
I started learning rails a few days ago and I'm reading head first rails
I have just started learning Rails and I'm trying to build a post/like type
Just started learning how to use paper_clip. I installed everything according the instructions and
So I'm getting started learning Rails. Now that Rails 3 is out, I want
I've recently started learning Ruby on Rails, based on RoR3 beta/RC. I had earlier
I just started learning rails. Could you help me understand parsing a single link?
I am learning ruby on rails. I started by importing some data into a
I started learning Ruby on Rails and found myself confounded by the syntax, so

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.