0

当我调用mina deploy -t一切顺利时,我正在尝试使用 mina 部署我的 first_app,直到它开始迁移数据库。这是我得到的错误。

Migrating database
$ RAILS_ENV="production" bundle exec rake db:migrate
rake aborted!
Gem::LoadError: Specified 'mysql' for database adapter, but the gem is not loaded.
Add   `gem 'mysql'` to your Gemfile.

所以我去了我的 Gemfile

source 'https://rubygems.org'   
ruby '2.0.0'
gem 'mina', '0.3.0'
#ruby-gemset=railstutorial_rails_4_0


# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.0.8'
gem 'mysql', '~> 2.9.1'

#group :development do
# Use sqlite3 as the database for Active Record
# gem 'sqlite3', '1.3.8'
#end

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

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

# Use CoffeeScript for .js.coffee assets and views
gem 'coffee-rails', '4.0.1'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby
# Use jquery as the JavaScript library
gem 'jquery-rails', '3.0.4'
# Turbolinks makes following links in your web application faster. Read more: 
gem 'turbolinks', '1.1.1'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '1.0.2'
group :doc do
    # bundle exec rake doc:rails generates the API under doc/api.
    gem 'sdoc', '0.3.20', require: false
end
# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'
# Use unicorn as the app server
# gem 'unicorn'
# Use Capistrano for deployment
# gem 'capistrano', group: :development
# Use debugger
# gem 'debugger', group: [:development, :test]

所以 gem 在那里,当我运行bundle install它时,它被列出,而不是在一个组中,因为你知道如果你使用该--without development选项,bundler 可以记住这一事实,并且不会包含开发组中的 gem。当 Icat 运行时更进一步

.
.
.
Using json 1.8.1
Using open4 1.3.4
Using mina 0.3.0
Using mysql 2.9.1
Using bundler 1.7.2
Using tilt 1.4.1
.
.
.

在 mina 部署期间它运行

 $ bundle install --without development:test --path "./vendor/bundle" --binstubs bin/  
 --deployment
   Using rake 10.3.2
   Using i18n 0.6.11
   Using minitest 4.7.5
   Using multi_json 1.10.1
   Using thread_safe 0.3.4
   Using tzinfo 0.3.41
   Using activesupport 4.0.8
   Using builder 3.1.4
   Using erubis 2.7.0
   Using rack 1.5.2
   Using rack-test 0.6.2
   Using actionpack 4.0.8
   Using mime-types 1.25.1
   Using polyglot 0.3.5
   Using treetop 1.4.15
   Using mail 2.5.4
   Using actionmailer 4.0.8
   Using activemodel 4.0.8
   Using activerecord-deprecated_finders 1.0.3
   Using arel 4.0.2
   Using activerecord 4.0.8
   Using coffee-script-source 1.8.0
   Using execjs 2.2.1
   Using coffee-script 2.3.0
   Using thor 0.19.1
   Using railties 4.0.8
   Using coffee-rails 4.0.1
   Using hike 1.2.3
   Using jbuilder 1.0.2
   Using jquery-rails 3.0.4
   Using json 1.8.1
   Using bundler 1.7.2
   Using tilt 1.4.1
   Using sprockets 2.11.0
   Using sprockets-rails 2.1.4
   Using rails 4.0.8
   Using rdoc 3.12.2
   Using sass 3.2.19
   Using sass-rails 4.0.3
   Using sdoc 0.3.20
   Using turbolinks 1.1.1
   Using uglifier 2.5.3
   Your bundle is complete!
   Gems in the groups development and test were not installed.

所以我在这里缺少什么,我觉得这与 mina 在捆绑期间包含和排除的组有关。任何帮助将不胜感激。

4

1 回答 1

1

mysql2是 MySQL 的较新 gem,您应该配置 yourdatabase.yml和 yourGemfile以使用它而不是mysql.

于 2014-09-14T22:29:00.610 回答