Ruby - ActiveRecord::ConnectionNotEstablished

I had the same problem, I started the sample-app from scratch and used this gemfile:

source 'http://rubygems.org'

gem 'rails', '3.1.1'

gem 'sqlite3'

group :development do
  gem 'rspec-rails', '2.6.1'
end


group :test do
  gem 'rspec-rails', '2.6.1'
  gem 'webrat', '0.7.1'
end

group :assets do
  gem 'sass-rails',   '~> 3.1.4'
  gem 'coffee-rails', '~> 3.1.1'
  gem 'uglifier', '>= 1.0.3'
end

gem 'jquery-rails'

This solved the problem for me :)


Make sure that you have installed sqlite3 gem.

If so did you run the following commands,

rake db:create # to create database
rake db:migrate # to create tables based on your migration

If the above two works fine, your application should be able to connect to the database. Else please copy the trace application trace over here, that may help us to help you better.


Try updating the sqlite3 gem. bundle update sqlite3