【发布时间】:2018-09-24 10:46:14
【问题描述】:
我在做heroku run rake db:migrate
这是错误:
Gem::LoadError:加载“sqlite3”Active Record 适配器时出错。 缺少它所依赖的宝石? sqlite3 不是捆绑包的一部分。添加它 到您的 Gemfile。
宝石文件:
group :production do
gem 'pg', '~> 0.18'
end
group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
# Use sqlite3 as the database for Active Record
gem 'sqlite3'
end
group :development do
# Access an interactive console on exception pages or by calling 'console' anywhere in the code.
gem 'web-console', '>= 3.3.0'
gem 'listen', '>= 3.0.5', '< 3.2'
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring'
gem 'spring-watcher-listen', '~> 2.0.0'
end
group :test do
# Adds support for Capybara system testing and selenium driver
gem 'capybara', '>= 2.15'
gem 'selenium-webdriver'
# Easy installation and use of chromedriver to run system tests with Chrome
gem 'chromedriver-helper'
end
Database.yml
production:
adapter: postgresql
encoding: Unicode
【问题讨论】:
-
grep -r sqlite3 .在您的 Rails 根目录中。 -
你添加
rails_12factorgem了吗? -
你的
RAILS_ENV是什么?那是开发还是测试?
标签: ruby-on-rails ruby heroku