Updating Rails 4.2 to 5.0.0 & sqlite3 gem will not load

1.3k views Asked by At

When running rails server, I load this warning:

Gem::LoadError: Specified 'sqlite3' for database adapter, but the gem is not loaded. Add `gem 'sqlite3'` to your Gemfile (and ensure its version is at the minimum required by ActiveRecord).

Yet my gemfile has the gem

 group :development do
   gem 'sqlite3'

What is causing this error?

Using instructions for rails update from here https://edgeguides.rubyonrails.org/upgrading_ruby_on_rails.html#upgrading-from-rails-4-2-to-rails-5-0

3

There are 3 answers

0
William Tran On BEST ANSWER
gem cleanup sqlite3

And

bundle install

to let Rails choose right version of sqlite3

0
GMarx On

Deleted gem sqlite3 ( v 1.4.0 ) and installed it with version 1.3.13 & it worked

0
Zolani Matebese On

Have the same problem in AWS cloud9 environment. You need to change your gemfile to read gem 'sqlite3', '~> 1.3.6' then run bundle update. got this from "can't activate sqlite3 (~> 1.3.6), already activated sqlite3-1.4.0"