WebFaction
Community site: login faq

Hi I'm getting a ActiveRecord::ConnectionNotEstablished after deploying my app to server via capistrano. I'm having a real nightmare with the deployment. I've deployed the code, I had a real problem trying to migrate the database, it kept telling my that sqlite3 was not included as part of my bundle - however as you can see from gem list, it is included under development. The only way I could get my site working was by adding sqlite3 gem in to the generic gems list and then it was running in development mode. I have since manged to migrate databse (I think) by running $ ~/webapps/myapp/gems/bin/bundle exec rake db:migrate RAILS_ENV=production. I was expecting to see a list of the reults as it ran the migrations, but it did it very quickly. However when I log in to the web console for my Postresql database phpPgAdmin I can see that the tables have been created.

See bottom for framework trace:

Driving me insane, please help.

Database.yml
development:
  adapter: sqlite3
  database: db/development.sqlite3
  pool: 5
  timeout: 5000

test:
  adapter: postgresql
  encoding: unicode
  database: locksafe
  pool: 5
  username: locksafe
  password: mypassword
  timeout: 5000

production:
  adapter: postgresql
  host: localhost
  database: locksafe
  username: locksafe
  password: mypassword

My Gem file:
source 'https://rubygems.org'

gem 'rails', '3.2.12'
gem 'bootstrap-sass', '~> 2.3.1.0'
gem 'bcrypt-ruby', '3.0.1'
gem 'faker', '1.0.1'
gem 'will_paginate', '3.0.3'
gem 'bootstrap-will_paginate', '0.0.6'
gem 'jquery-rails', '2.0.2'
gem 'turbolinks'
gem 'best_in_place'
gem 'carrierwave'
gem 'rmagick'
gem 'jasny_bootstrap_extension_rails'
gem "therubyracer", :require => 'v8'
gem 'simple_form'
gem 'prawn'
gem 'capistrano', '~> 2.15'

group :development, :test do
  gem 'sqlite3', '1.3.5'
  gem 'rspec-rails', '2.11.0'
  gem 'guard-rspec', '1.2.1'
  gem 'guard-spork', '1.2.0'  
  gem 'spork', '0.9.2'
  gem 'childprocess', '0.3.6'
  gem 'better_errors'
  gem 'binding_of_caller'
  gem 'rack-mini-profiler'
end

group :assets do
  gem 'sass-rails',   '3.2.5'
  gem 'coffee-rails', '3.2.2'
  gem 'uglifier', '1.2.3'
  gem 'jquery-datatables-rails', :github => 'rweng/jquery-datatables-rails'
  gem 'jquery-ui-rails'
end

group :test do
  gem 'capybara', '1.1.2'
  gem 'factory_girl_rails', '4.1.0'
  gem 'cucumber-rails', '1.2.1', :require => false
  gem 'database_cleaner', '0.7.0'
  gem 'launchy', '2.1.0'
  gem 'rb-fsevent', '0.9.1', :require => false
  gem 'growl', '1.0.3'
end

group :production do
  gem 'pg'
end

Framework trace:

    activerecord (3.2.12) lib/active_record/connection_adapters/abstract/connection_pool.rb:410:in `retrieve_connection'
activerecord (3.2.12) lib/active_record/connection_adapters/abstract/connection_specification.rb:171:in `retrieve_connection'
activerecord (3.2.12) lib/active_record/connection_adapters/abstract/connection_specification.rb:145:in `connection'
activerecord (3.2.12) lib/active_record/query_cache.rb:67:in `rescue in call'
activerecord (3.2.12) lib/active_record/query_cache.rb:61:in `call'
activerecord (3.2.12) lib/active_record/connection_adapters/abstract/connection_pool.rb:479:in `call'
actionpack (3.2.12) lib/action_dispatch/middleware/callbacks.rb:28:in `block in call'
activesupport (3.2.12) lib/active_support/callbacks.rb:405:in `_run__2646040844887634500__call__2874730587577401763__callbacks'
activesupport (3.2.12) lib/active_support/callbacks.rb:405:in `__run_callback'
activesupport (3.2.12) lib/active_support/callbacks.rb:385:in `_run_call_callbacks'
activesupport (3.2.12) lib/active_support/callbacks.rb:81:in `run_callbacks'
actionpack (3.2.12) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
actionpack (3.2.12) lib/action_dispatch/middleware/reloader.rb:65:in `call'
actionpack (3.2.12) lib/action_dispatch/middleware/remote_ip.rb:31:in `call'
actionpack (3.2.12) lib/action_dispatch/middleware/debug_exceptions.rb:16:in `call'
actionpack (3.2.12) lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
railties (3.2.12) lib/rails/rack/logger.rb:32:in `call_app'
railties (3.2.12) lib/rails/rack/logger.rb:16:in `block in call'
activesupport (3.2.12) lib/active_support/tagged_logging.rb:22:in `tagged'
railties (3.2.12) lib/rails/rack/logger.rb:16:in `call'
actionpack (3.2.12) lib/action_dispatch/middleware/request_id.rb:22:in `call'
rack (1.4.5) lib/rack/methodoverride.rb:21:in `call'
rack (1.4.5) lib/rack/runtime.rb:17:in `call'
activesupport (3.2.12) lib/active_support/cache/strategy/local_cache.rb:72:in `call'
rack (1.4.5) lib/rack/lock.rb:15:in `call'
actionpack (3.2.12) lib/action_dispatch/middleware/static.rb:62:in `call'
railties (3.2.12) lib/rails/engine.rb:479:in `call'
railties (3.2.12) lib/rails/application.rb:223:in `call'
railties (3.2.12) lib/rails/railtie/configurable.rb:30:in `method_missing'
passenger (3.0.11) lib/phusion_passenger/rack/request_handler.rb:96:in `process_request'
passenger (3.0.11) lib/phusion_passenger/abstract_request_handler.rb:513:in `accept_and_process_next_request'
passenger (3.0.11) lib/phusion_passenger/abstract_request_handler.rb:274:in `main_loop'
passenger (3.0.11) lib/phusion_passenger/rack/application_spawner.rb:206:in `start_request_handler'
passenger (3.0.11) lib/phusion_passenger/rack/application_spawner.rb:79:in `block in spawn_application'
passenger (3.0.11) lib/phusion_passenger/utils.rb:479:in `safe_fork'
passenger (3.0.11) lib/phusion_passenger/rack/application_spawner.rb:64:in `spawn_application'
passenger (3.0.11) lib/phusion_passenger/spawn_manager.rb:264:in `spawn_rack_application'
passenger (3.0.11) lib/phusion_passenger/spawn_manager.rb:137:in `spawn_application'
passenger (3.0.11) lib/phusion_passenger/spawn_manager.rb:275:in `handle_spawn_application'
passenger (3.0.11) lib/phusion_passenger/abstract_server.rb:357:in `server_main_loop'
passenger (3.0.11) lib/phusion_passenger/abstract_server.rb:206:in `start_synchronously'
passenger (3.0.11) helper-scripts/passenger-spawn-server:99:in `<main

'

asked 21 Nov '13, 11:11

leerowbotham
12
accept rate: 0%

edited 21 Nov '13, 11:18

Be the first one to answer this question!
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×109
×108
×81
×32
×20

question asked: 21 Nov '13, 11:11

question was seen: 2,311 times

last updated: 21 Nov '13, 11:18

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM