0

I have recently update my Rail 3.2 to 4. Also Ruby 1.9.3 to 2.0.0.

Everything has been working fine for a couple of week and I cannot figure out why I cannot suddenly start my local server.

I get the following error

/usr/local/rvm/gems/ruby-2.0.0-p247/gems/activerecord-4.0.0/lib/active_record/connection_adapters/connection_specification.rb:58:in `rescue in resolve_hash_connection': Specified 'sqlite3' for database adapter, but the gem is not loaded. Add `gem 'sqlite3'` to your Gemfile. (Gem::LoadError)

My gemfile has always has sqlite3 in a

group :development, :test do
    gem 'sqlite3'
end

I can get my local server to work only if I move the sqlite3 out of the dev and test group

I've run bundle check and all dependencies have been satisfied. bundle install every single time works.

I also explicitly started the server this way rails s -e development and still get the error

Help, please?

Ervin E
  • 442
  • 5
  • 18

2 Answers2

0

Check your database.yml file and see if you are using right sqlite credentials (if using sqlite DB) to connect to it.

techvineet
  • 5,041
  • 2
  • 30
  • 28
0

First, check bundle list and look for sqlite3. If it's not there, it is not included in your bundle.

Then, keep in mind that the group part around the gem definition acts as a filter of sorts. The gem will not be installed if you run something like bundle install --without development test. Even if you are not excluding these environments in the command now: if you ever have, the parameters have been persisted to ./.bundle/config. Remove it from there and do your fresh install.

KappaNossi
  • 2,656
  • 1
  • 15
  • 17
  • I have two versions of sqlite3... 1.3.8 and 1.3.7... My gemlock says it is using 1.3.8 I've run "bundle isntall" and "bundle update" as well and nothing – Ervin E Oct 01 '13 at 08:50