Capistrano 3:KeyError:未找到密钥:" staging"

时间:2016-03-28 14:19:26

标签: ruby-on-rails ruby-on-rails-4 deployment capistrano capistrano3

我正在尝试部署到登台服务器:

配置/部署/共享/ staging.rb

ng-include

deploy.rb

server 'Server_IP', user: 'deploy', roles: %w{app primary db}

set :rails_env, 'staging'

namespace :deploy do
end

在服务器上... forlder shared / config / database.yml

(...)
# Default value for :linked_files is []
set :linked_files, fetch(:linked_files, []).push(*[
  "config/database.yml", "config/resque-pool.yml", "config/unicorn.rb"
])
(...)

GOD设置:

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

更新

因此更新有额外的痕迹

是cap staging deploy --trace

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"

0 个答案:

没有答案