我正在尝试部署到登台服务器:
ng-include
server 'Server_IP', user: 'deploy', roles: %w{app primary db}
set :rails_env, 'staging'
namespace :deploy do
end
(...)
# Default value for :linked_files is []
set :linked_files, fetch(:linked_files, []).push(*[
"config/database.yml", "config/resque-pool.yml", "config/unicorn.rb"
])
(...)
staging:
adapter: "mysql2"
database: "my_app"
encoding: "utf8"
host: "127.0.0.1"
username: "deploy"
password: "mypassword"
reconnect: true
port: 3306
我不知道为什么我在以下时遇到错误:God.watch do |w|
(...)
w.env = {
"HOME" => "",
"RAILS_ENV" => "staging",
"SECRET_KEY_BASE" => "here my secret key base",
"PATH" => "/opt/rubies/ruby-2.2.4/bin:#{ENV["PATH"]}"
}
(...)
w.start = "/opt/rubies/ruby-2.2.4/bin/bundle exec unicorn_rails -c /var/www/my_app/current/config/unicorn.rb -E staging -D"
be cap staging deploy
因此更新有额外的痕迹
INFO [f85a78fc] Running bundle exec rake db:migrate as deploy@Server_IP
DEBUG [f85a78fc] Command: cd /var/www/my_app/releases/12345678 && ( export PATH="/opt/rubies/ruby-2.2.4/bin:$PATH" RAILS_ENV="staging" ; bundle exec rake db:migrate )
DEBUG [f85a78fc] rake aborted!
DEBUG [f85a78fc]
DEBUG [f85a78fc] KeyError: key not found: "staging"