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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T20:07:34+00:00 2026-06-04T20:07:34+00:00

I created a simple rails application: 1 $ rails new myapp1 -d postrgresql 2

  • 0

I created a simple rails application:

1

$ rails new myapp1 -d postrgresql

2. Removed /public/index.html

3. Created the Homecontroller and the actions

4. Wrote the routes

myapp1::Application.routes.draw do

  root :to => "home#index"
  match 'about' => 'home#about'
  match 'contacts' => 'home#contacts'
  match 'projects' => 'home#projects'
end

5. Created the views and the default layout

6. The bottom line. Here is the database.yml

development:

  adapter: postgresql
  encoding: unicode
  database: myapp1_db
  host: localhost
  pool: 5
  username: myapp1_user
  password: 1234
 
test:
  adapter: postgresql
    encoding: unicode
    database: myapp1_db
    host: localhost
    pool: 5
    username: myapp1_user
    password: 1234

production:
  adapter: postgresql
    encoding: unicode
    database: myapp1_db
    host: localhost
    pool: 5
    username: myapp1_user
    password: 1234

and of course I created user and database

sudo -u postgres psql
postgres=# \password
postgres=# create user myapp1_user with password '1234';
postgres=# create database myapp1_db owner myapp1_user; 

But there are some worries:

1. Now I don’t use any database, but in spite of this the application gives an error

PG::Error FATAL: Peer authentication failed for user "myapp1"

2. It seems like rails turns a blind eye to database.yml. Why does it use the user myapp1 instead of myapp1_user?

  • 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-04T20:07:36+00:00Added an answer on June 4, 2026 at 8:07 pm

    Whitespace is significant in YAML.

    production:
      adapter: postgresql
        encoding: unicode
        ...
        password: 1234
    

    Should be:

    production:
      adapter: postgresql
      encoding: unicode
      ...
      password: 1234
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a simple application using rails new simple_cms -d mysql2 After running
I have created a simple blog application with Ruby on Rails. The applications consists
I have created a simple API for a Rails application using token-based-authentication that supports
I've created a simple mountable application in rails 3.1.3 using command: $ rails plugin
I am new to Httparty. I have a simple rails application with its default
I have created a rails application that has a simple RESTful json API. This
I've created a clean and simple Rails 3.1 application called demo1. It contains two
I'm trying to create a simple application with Ruby on Rails. I've created this
I develop a Rails application and I added simple route: Name::Application.routes.draw do resource :categories
I created a simple private messaging app through rails, but I am trying to

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.