Gem::LoadError: Specified 'sqlite3' for da

2019-04-05 23:26发布

I'm trying to push my app to heroku but am getting this message.

Gem::LoadError: Specified 'sqlite3' for database adaptor, but the gem is not loaded.

But I did not. I don't have sqlite3 anywhere in my database.yml file

development:
  adapter: postgresql
  encoding: unicode
  database: blog_development
  pool: 5
  timeout: 5000
  host:  localhost

test:
  adapter: postgresql
  database: blog_test
  pool: 5
  timeout: 5000

production:
  adapter: postgresql
  database: blog_production
  pool: 5
  timeout: 5000

My adapter name is psotgresql. I even opened the file myself

cat database.yml

I searched through the file but could not find postgresql. Here is my gemfile

ruby '2.1.0'
gem 'rails', '4.1.1'

group :development, :test do
  gem 'pg', '0.17.1'
  gem 'rspec-rails', '3.0.1'
end

group :production do
  gem 'pg', '0.17.1'
  gem 'rails_12factor'
end

group :test do
  gem 'selenium-webdriver', '2.35.1'
  gem 'capybara', '2.1.0'
end

gem 'sass-rails', '~> 4.0.2'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.0.0'
gem 'sprockets-rails', '~> 2.1.3'
gem 'bootstrap-sass', '3.1.1.1'

gem 'jquery-rails'
gem 'turbolinks'
gem 'jbuilder', '~> 2.1.1'

group :doc do

  gem 'sdoc', require: false
end

gem 'bcrypt', '~> 3.1.7'

I have pg located in the production environment here. I have ran bundle install, bundle update, git add, git commit, and git push heroku master numerous times and I still get this message.

I don't understand this. I did NOT specify sqlite3 for my database adaptor.

I'm at a loss for words.

4条回答
贪生不怕死
2楼-- · 2019-04-05 23:47

I had this issue.

I had manually removed "pg (0.17.1)" from Gemfile.lock in an attempt to cover my tracks after neglecting to put the '--without production' param in for bundle install. Adding back solved the issue.

查看更多
我想做一个坏孩纸
3楼-- · 2019-04-05 23:49

I had to specify my sqlite3 version as 1.3.13:

gem 'sqlite3', '~> 1.3.13'

Then run bundle update.

查看更多
smile是对你的礼貌
4楼-- · 2019-04-05 23:49

Had same issue when starting a rails 5.0 tutorial on cloud9 IDE (amazon). Default sqlite3 version installed by running {rails new} within the cloud editor was 3.7.17 2013-05-20

this solved my problem : gem 'sqlite3', '~> 1.4.0'}

After this I succeeded to launch the "yay you're on rails page"

查看更多
够拽才男人
5楼-- · 2019-04-05 23:55

It sounds like you might have either:

  1. forgot to run bundle update or bundle install to update your Gemfile.lock file, or

  2. forgot to commit your Gemfile and Gemfile.lock changes to Git with git commit before pushing to Heroku.

If your problem is the 2nd case, then this question is a duplicate, I just have to find the canonical question around somewhere...

查看更多
登录 后发表回答