【发布时间】:2012-05-06 17:02:24
【问题描述】:
我有一个使用 Capistrano 部署的 Rails 3.2.3 应用程序。到目前为止,这个工作流程已经完美运行了几个月。但自上次部署最新更改以来,rake db:migrate 操作挂起,因为它找不到 SQLite3 gem 和适配器。
executing "cd /home/*/*/*/releases/20120425232058 && bundle exec rake RAILS_ENV=production db:migrate"
executing command
rake aborted!
Please install the sqlite3 adapter: `gem install activerecord-sqlite3-adapter` (sqlite3 is not part of the bundle. Add it to Gemfile.)
问题是,应用程序正在 MySQL 上运行。我的 Gemfile 中有:
source 'https://rubygems.org'
gem 'rails', '3.2.3'
gem 'jquery-rails'
gem 'omniauth-openid'
gem 'will_paginate'
gem 'pusher'
gem 'carrierwave'
gem 'capistrano'
group :assets do
gem 'sass-rails', '~> 3.2.3'
gem 'coffee-rails', '~> 3.2.1'
gem 'uglifier', '>= 1.0.3'
end
group :development, :production do
gem 'mysql2'
end
group :production do
gem 'unicorn'
end
以及 database.yml 文件:
development:
adapter: mysql2
encoding: utf8
reconnect: false
database: *****_development
pool: 5
username: *****
password: *****
host: localhost
production:
adapter: mysql2
encoding: utf8
reconnect: false
database: *****_production
pool: 5
username: *****
password: *****
host: localhost
应用程序在我的本地计算机上以生产模式运行,没有问题。
为什么 Rails 会尝试安装 SQLite?
【问题讨论】:
-
你能发布你的 gemfile 和 database.yml 吗?
-
检查你的gemfile中没有sqlite gem,或者如果你有然后确保它在测试组中
-
sqlite gem 从未在 Gemfile 中。上面的配置已经工作了几个月。它只是现在才开始要求它。
标签: mysql ruby-on-rails sqlite rake capistrano