Heroku声明“为数据库适配器指定'sqlite3'”

时间:2014-02-19 17:38:45

标签: ruby-on-rails heroku

Heroku声明“指定的'sqlite3'用于数据库适配器,但未加载gem。在初始提交中将gem 'sqlite3'添加到您的Gemfile”。

我已经更改了我的Gemfile,因此在开发中使用sqlite,在生产模式下使用pg。我的database.yml被添加到.gitignore文件中。有没有我需要将sqlite更改为pg的地方?

提前致谢

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.0.1'
gem 'activeadmin', github: 'gregbell/active_admin'
gem 'anjlab-bootstrap-rails', :require => 'bootstrap-rails',
                          :github => 'anjlab/bootstrap-rails',
                          :branch => '3.0.0'
gem "font-awesome-rails"
gem "json"
gem "nokogiri"
gem "leaflet-rails"
gem "mapbox-rails"

# Use SCSS for stylesheets
gem 'sass-rails', '~> 4.0.0'

# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'

# Use CoffeeScript for .js.coffee assets and views
gem 'coffee-rails', '~> 4.0.0'

# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby

# Use jquery as the JavaScript library
gem 'jquery-rails'

# Turbolinks makes following links in your web application faster. Read more:   https://github.com/rails/turbolinks
gem 'turbolinks'

# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 1.2'

group :doc do
  # bundle exec rake doc:rails generates the API under doc/api.
  gem 'sdoc', require: false
end

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

group :development do 
  gem 'sqlite3'
  gem 'better_errors'
  gem "binding_of_caller"
end


# Use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.1.2'

# Use unicorn as the app server
# gem 'unicorn'

# Use Capistrano for deployment
# gem 'capistrano', group: :development

# Use debugger
# gem 'debugger', group: [:development, :test]

1 个答案:

答案 0 :(得分:0)

我以前跑过

bundle install --without production

我的问题的解决方案是安装生产宝石。我的生产宝石与“指定的sqlite3适配器”有什么关系,我完全不明白。