我有一个使用 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 ?