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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T14:36:22+00:00 2026-06-13T14:36:22+00:00

Rails/PostgreSQL newbie here, having real problems dealing with creating PostgreSQL projects in Rails. Briefly,

  • 0

Rails/PostgreSQL newbie here, having real problems dealing with creating PostgreSQL projects in Rails.

Briefly, I am following Ryans excellent Railscast episodes, in particular the episode on deployment. I create a new project like this:

rails new blog -d postgresql

This generates a database.yml file similar to the following (comments extracted):

development:
  adapter: postgresql
  encoding: unicode
  database: blog_development
  pool: 5
  username: blog
  password:

test:
  adapter: postgresql
  encoding: unicode
  database: blog_test
  pool: 5
  username: blog
  password:

production:
  adapter: postgresql
  encoding: unicode
  database: blog_production
  pool: 5
  username: blog
  password:

Looks good so far.

However, on my development machine, whenever I try to run rake db:create:all, I get a message similar to the following:

rake aborted!
FATAL: role "blog" does not exist

My understanding is that this is because I haven’t (or, rather, Rails hasn’t) created a user called “blog” when the application was created. Therefore, I need to either:

  1. Change the username for all environments to my system’s “super
    user” I chose when I installed Homebrew (which works); OR
  2. Create a new super user for each individual project I set up (e.g. a
    super user “blog” in this instance).

Now, the problem is this – should I be creating a super user for each individual project I create? If so, how? The reason I ask is that Ryan’s Railscasts episodes never actually mention this, so I’m not sure if this is the correct approach to be taking (it seems a bit long-winded), or if there is a problem with my PostgreSQL database installation (as I would have thought that the super user would be automatically set up along with the database when the application is created).

Additionally, so as to make deployment easier, I’d like to keep the overall database.yml file the same in both the development and production environments (although I admit to knowing even less about deployment, so maybe this isn’t ideal).

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-13T14:36:24+00:00Added an answer on June 13, 2026 at 2:36 pm

    Creating database users is up to you. Rails does not create database users.

    Depending on your platform, you can use some kind of database management GUI to make it easier to create users and manage their rights. I use PGAdmin, which came with the Mac OS X executable for PostgreSQL. It is available for other platforms as well.

    In development, many people use the same “superuser” for all projects. In production, I would advice you to have application-specific users with minimal privileges.

    I don’t exactly understand the last paragraph about the database.yml being the same for dev and prod envs, because that is precisely the point – one file for all environments. You should probably not use the same credentials for development and production.

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

Sidebar

Related Questions

In my Rails app, I have the following PostgreSQL query to find the most
I am following the Rails Tutorial with the database set up using postgreSQL so
Framework: Rails 2.3.8 Database; PostgreSQL I currently have the following SQL statements (generated by
Newbie question on Rails 3 development. I am creating my first app and planning
When i run my migration in Rails application on postgresql i got following NOTICES
Having an Issue. Running PostgreSQL,Rails 3.2.3 , Ruby 1.9.2p180 and 1.9.3(via Pik) on Windows
How to make this (PostgreSQL) using Rails syntax?: SELECT fld1, fld2 FROM ( SELECT
Can I use MongoDB and a PostgreSQL in one rails app? Specifically I will
I am thinking of working on a Rails application that uses PostgreSQL. I have
I am working on my app (Rails 3.2, PostgreSQL 9.1) on localhost and everything

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.