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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T06:39:06+00:00 2026-06-14T06:39:06+00:00

I’m having a problem connecting to the development database in Sinatra. The guy that

  • 0

I’m having a problem connecting to the development database in Sinatra. The guy that is doing the back end is in New York and is not available at the moment. I’m more familiar with the front end and was wondering, is there something simple that I am missing?

The production database connects, ok, but when I try launching it in development mode I get a bunch of errors in the terminal. I also tried using launching thin using port 5432 with no success.

Any Ideas? edit added models.rb below

Terminal

mdb|moreButton⚡ ⇒ ruby app.rb   
/Users/adam/.rvm/gems/ruby-1.9.3-p125@sinatra/gems/data_objects-0.10.10/lib/data_objects/connection.rb:79:in `initialize': could not connect to server: Connection     refused (DataObjects::ConnectionError)
    Is the server running on host "localhost" (127.0.0.1) and accepting
    TCP/IP connections on port 5432?
could not connect to server: Connection refused
    Is the server running on host "localhost" (::1) and accepting
    TCP/IP connections on port 5432?
could not connect to server: Connection refused
    Is the server running on host "localhost" (fe80::1) and accepting
    TCP/IP connections on port 5432?
    from /Users/adam/.rvm/gems/ruby-1.9.3-p125@sinatra/gems/data_objects-0.10.10/lib/data_objects/connection.rb:79:in `new'
    from /Users/adam/.rvm/gems/ruby-1.9.3-p125@sinatra/gems/data_objects-0.10.10/lib/data_objects/pooling.rb:181:in `block in new'
    from <internal:prelude>:10:in `synchronize'
    from /Users/adam/.rvm/gems/ruby-1.9.3-p125@sinatra/gems/data_objects-0.10.10/lib/data_objects/pooling.rb:176:in `new'
    from /Users/adam/.rvm/gems/ruby-1.9.3-p125@sinatra/gems/data_objects-0.10.10/lib/data_objects/pooling.rb:121:in `new'
    from /Users/adam/.rvm/gems/ruby-1.9.3-p125@sinatra/gems/data_objects-0.10.10/lib/data_objects/connection.rb:68:in `new'
    from /Users/adam/.rvm/gems/ruby-1.9.3-p125@sinatra/gems/dm-do-adapter-1.2.0/lib/dm-do-adapter/adapter.rb:251:in `open_connection'
    from /Users/adam/.rvm/gems/ruby-1.9.3-p125@sinatra/gems/dm-transactions-1.2.0/lib/dm-transactions/adapters/dm-do-adapter.rb:69:in `open_connection'
    from /Users/adam/.rvm/gems/ruby-1.9.3-p125@sinatra/gems/dm-do-adapter-1.2.0/lib/dm-do-adapter/adapter.rb:276:in `with_connection'
    from /Users/adam/.rvm/gems/ruby-1.9.3-p125@sinatra/gems/dm-do-adapter-1.2.0/lib/dm-do-adapter/adapter.rb:33:in `select'
    from /Users/adam/.rvm/gems/ruby-1.9.3-p125@sinatra/gems/dm-migrations-1.2.0/lib/dm-migrations/adapters/dm-postgres-adapter.rb:45:in `schema_name'
    from /Users/adam/.rvm/gems/ruby-1.9.3-p125@sinatra/gems/dm-migrations-1.2.0/lib/dm-migrations/adapters/dm-do-adapter.rb:26:in `storage_exists?'
    from /Users/adam/.rvm/gems/ruby-1.9.3-p125@sinatra/gems/dm-migrations-1.2.0/lib/dm-migrations/auto_migration.rb:65:in `storage_exists?'
    from /Users/adam/.rvm/gems/ruby-1.9.3-p125@sinatra/gems/dm-migrations-1.2.0/lib/dm-migrations/auto_migration.rb:120:in `storage_exists?'
    from /Users/adam/.rvm/gems/ruby-1.9.3-p125@sinatra/gems/dm-constraints-1.2.0/lib/data_mapper/constraints/migrations/model.rb:22:in `auto_migrate_constraints_down'
    from /Users/adam/.rvm/gems/ruby-1.9.3-p125@sinatra/gems/dm-constraints-1.2.0/lib/data_mapper/constraints/migrations/singleton_methods.rb:39:in `block in     auto_migrate_constraints_down'
    from /Users/adam/.rvm/gems/ruby-1.9.3-p125@sinatra/gems/dm-core-1.2.0/lib/dm-core/support/descendant_set.rb:64:in `block in each'
    from /Users/adam/.rvm/gems/ruby-1.9.3-p125@sinatra/gems/dm-core-1.2.0/lib/dm-core/support/subject_set.rb:210:in `block in each'
    from /Users/adam/.rvm/gems/ruby-1.9.3-p125@sinatra/gems/dm-core-1.2.0/lib/dm-core/support/ordered_set.rb:319:in `block in each'
    from /Users/adam/.rvm/gems/ruby-1.9.3-p125@sinatra/gems/dm-core-1.2.0/lib/dm-core/support/ordered_set.rb:319:in `each'
    from /Users/adam/.rvm/gems/ruby-1.9.3-p125@sinatra/gems/dm-core-1.2.0/lib/dm-core/support/ordered_set.rb:319:in `each'
    from /Users/adam/.rvm/gems/ruby-1.9.3-p125@sinatra/gems/dm-core-1.2.0/lib/dm-core/support/subject_set.rb:210:in `each'
    from /Users/adam/.rvm/gems/ruby-1.9.3-p125@sinatra/gems/dm-core-1.2.0/lib/dm-core/support/descendant_set.rb:63:in `each'
    from /Users/adam/.rvm/gems/ruby-1.9.3-p125@sinatra/gems/dm-constraints-1.2.0/lib/data_mapper/constraints/migrations/singleton_methods.rb:38:in     `auto_migrate_constraints_down'
    from /Users/adam/.rvm/gems/ruby-1.9.3-p125@sinatra/gems/dm-constraints-1.2.0/lib/data_mapper/constraints/migrations/singleton_methods.rb:7:in `auto_migrate!'
    from /Users/adam/Git/mdb/models.rb:403:in `<top (required)>'
    from /Users/adam/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /Users/adam/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from app.rb:1:in `<main>'

My Gemset

mdb|moreButton⚡ ⇒ gem list

*** LOCAL GEMS ***

addressable (2.2.8)
backports (2.6.4, 2.6.1)
bcrypt-ruby (3.0.1)
bundler (1.1.5)
daemons (1.1.9)
data_mapper (1.2.0)
data_objects (0.10.10, 0.10.8)
dm-adjust (1.2.0)
dm-aggregates (1.2.0)
dm-constraints (1.2.0)
dm-core (1.2.0)
dm-do-adapter (1.2.0)
dm-migrations (1.2.0)
dm-postgres-adapter (1.2.0)
dm-serializer (1.2.2, 1.2.1)
dm-sqlite-adapter (1.2.0)
dm-timestamps (1.2.0)
dm-transactions (1.2.0)
dm-types (1.2.2, 1.2.1)
dm-validations (1.2.0)
do_postgres (0.10.10, 0.10.8)
do_sqlite3 (0.10.10, 0.10.8)
eventmachine (1.0.0, 0.12.10)
fastercsv (1.5.5)
hpricot (0.8.6)
json (1.7.5, 1.6.7)
json_pure (1.7.5, 1.6.7)
mime-types (1.19)
multi_json (1.3.6, 1.0.4)
multimap (1.1.2)
rack (1.4.1)
rack-protection (1.2.0)
rack-test (0.6.2, 0.6.1)
rake (0.9.2.2)
rest-client (1.6.7)
rubygems-bundler (1.0.3)
rvm (1.11.3.5)
sass (3.2.1)
shotgun (0.9)
sinatra (1.3.3, 1.3.2)
sinatra-contrib (1.3.1)
sinatra-reloader (1.0)
stringex (1.4.0, 1.3.3)
thin (1.5.0)
tilt (1.3.3)
time-ago-in-words (0.1.2)
uuidtools (2.1.3, 2.1.2)

app.rb gemfile

source 'http://rubygems.org'
gem 'sinatra'
gem 'data_mapper'
gem 'hpricot'
gem 'dm-core'
gem 'json'
gem 'dm-postgres-adapter'
gem 'dm-adjust'
gem 'time-ago-in-words'
gem 'sass'
gem 'rest-client'
gem 'multimap'

group :development do
  gem "dm-sqlite-adapter"
  gem 'sinatra-reloader'
end

models.rb

if $development
    DataMapper.setup(:default, "postgres://localhost/mistakesdb_default")
else
    DataMapper.setup(:default, "postgres://giberish:giberish@ec2-23-21-209-147.compute-1.amazonaws.com:5432/giberish")
end
DataMapper.finalize
if $development
    #DataMapper.auto_upgrade!
    DataMapper.auto_migrate!
else
    DataMapper.auto_upgrade!
    #DataMapper.auto_migrate!
end

###### required.rb ######
$development = File.exists?('/Users/adam')

##### Top of app.rb #####
require "./models.rb"
require "./required.rb"
require "sinatra"
require "sass"
require "sinatra/reloader" if $development
require "time-ago-in-words"
require "rest_client"
require "multimap"
  • 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-14T06:39:07+00:00Added an answer on June 14, 2026 at 6:39 am

    In development mode DataMapper is trying to connect to a local PostgreSQL database called mistakesdb_default. It appears that you don’t have a local postgres install running at all, hence the “connection refused” error. Depending on your operating system, you might be able to find an easy postgres installer at http://www.enterprisedb.com/.

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am doing a simple coin flipping experiment for class that involves flipping a
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I am currently running into a problem where an element is coming back from
I need a function that will clean a strings' special characters. I do NOT
Let's say I'm outputting a post title and in our database, it's Hello Y&#8217;all
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I've got a string that has curly quotes in it. I'd like to replace
I have a small JavaScript validation script that validates inputs based on Regex. I

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.