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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T11:20:49+00:00 2026-06-11T11:20:49+00:00

Just start with rails and Linux a few days a go… I want to

  • 0

Just start with rails and Linux a few days a go…
I want to deploy to heroku and one of there best practice is to user postgresql in local environment too anyway… I followed one of there tutorials and created a sample application

the pg gem installed. bundle install works ok. rake db:migrate works and created the table for my application. but… when i try to run my rails page it gives this error:

ActiveRecord::ConnectionNotEstablished

This is the end of the full trace:

> activerecord (3.2.3) lib/active_record/connection_adapters/abstract/connection_pool.rb:398:in `retrieve_connection'
activerecord (3.2.3) lib/active_record/connection_adapters/abstract/connection_specification.rb:168:in `retrieve_connection'
activerecord (3.2.3) lib/active_record/connection_adapters/abstract/connection_specification.rb:142:in `connection'
activerecord (3.2.3) lib/active_record/query_cache.rb:67:in `rescue in call'
activerecord (3.2.3) lib/active_record/query_cache.rb:61:in `call'
activerecord (3.2.3) lib/active_record/connection_adapters/abstract/connection_pool.rb:467:in `call'
actionpack (3.2.3) lib/action_dispatch/middleware/callbacks.rb:28:in `block in call'
activesupport (3.2.3) lib/active_support/callbacks.rb:405:in `_run__4423031206660944571__call__1711406629982304701__callbacks'
activesupport (3.2.3) lib/active_support/callbacks.rb:405:in `__run_callback'
activesupport (3.2.3) lib/active_support/callbacks.rb:385:in `_run_call_callbacks'
activesupport (3.2.3) lib/active_support/callbacks.rb:81:in `run_callbacks'
actionpack (3.2.3) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
actionpack (3.2.3) lib/action_dispatch/middleware/reloader.rb:65:in `call'
actionpack (3.2.3) lib/action_dispatch/middleware/remote_ip.rb:31:in `call'
actionpack (3.2.3) lib/action_dispatch/middleware/debug_exceptions.rb:16:in `call'
actionpack (3.2.3) lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'

i am using pgadmin 3 to see my db. i created a user named schaller which is the same as my user in Ubuntu

my database.yml file:

development:
  adapter: postgresql
  database: rails
  encoding: unicode
  username: schaller
  password: password123
  host: localhost
  pool: 5

what else can i check in order for rails to connect to postgres?

edit:

error when starting the rails server in netbeans on webrick

Started GET “/gangs/” for 127.0.0.1 at 2012-09-13 23:12:31 +0300
ActiveRecord::ConnectionNotEstablished (ActiveRecord::ConnectionNotEstablished):
activerecord (3.2.3) lib/active_record/connection_adapters/abstract /connection_pool.rb:398:in retrieve_connection'
activerecord (3.2.3) lib/active_record/connection_adapters/abstract /connection_specification.rb:168:in
retrieve_connection’
activerecord (3.2.3) lib/active_record/connection_adapters/abstract /connection_specification.rb:142:in connection'
activerecord (3.2.3) lib/active_record/query_cache.rb:67:in
rescue in call’
…

edit the main stuff in my gem file:

gem 'rails', '3.2.3'
gem 'pg'
gem 'thin'

edit:
adding logs for the postgresql connections

[local]
2012-09-15 18:05:35 IDT LOG:  connection received: host=127.0.0.1 port=44038
2012-09-15 18:05:35 IDT LOG:  connection authorized: user=schaller database=postgres
2012-09-15 18:05:35 IDT LOG:  connection received: host=127.0.0.1 port=44039
2012-09-15 18:05:35 IDT LOG:  connection authorized: user=schaller database=rails
2012-09-15 18:07:26 IDT LOG:  connection received: host=127.0.0.1 port=44048
2012-09-15 18:07:26 IDT LOG:  connection authorized: user=schaller database=rails

anyway i see logs being written when i connect with pgadmin 3 and when i run the command, ‘rake db:migrate’ but not when i run my rails app…

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-11T11:20:50+00:00Added an answer on June 11, 2026 at 11:20 am

    OK so its been a few days.. i read all answers and comments again because i really needed a solution anyway! the comment left by @Muhammad Sannan did the trick. i am new to rails so i didn’t know what an adapter is.. but after a quick google search i ran this command:

    gem install activerecord-postgresql-adapter
    

    and that did the trick 🙂

    everything is working now. i just don’t understand how db:migrate worked without this adapter..

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

Sidebar

Related Questions

I just started using Rails a few days ago, and I'm having trouble with
For http://github.com/collectiveidea/delayed_job Let's say I just start a brand new Rails project and want
I want to load My ACL plugin to the application, and just start working
I just updated to rails 3.2 and twitter gem 2.0.2 Now when I start
I have just inherited a medium sized Rails application and I want to try
I'm just start to develop on Ruby on Rails and i've question about complex
I have one (EC2) Ubuntu server where bluepill is working just fine to start
I've just set up rvm with a gemset for rails 3.1 to start building
My Rails app is starting to need complicated queries. Should I just start using
I'm just getting started with rails and ruby and i wanna start giving back

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.