Capistrano Nginx和Puma Deploy到ubuntu 14.04

时间:2017-04-05 07:10:17

标签: ruby-on-rails ubuntu nginx capistrano3 puma

我刚刚将我的应用程序部署到带有Capistrano的Ubuntu 14.04这些文件 的Gemfile

  gem 'capistrano', '3.5.0'
  gem 'capistrano-rvm'
  gem 'capistrano-nginx'
  gem 'capistrano3-puma'
  gem 'capistrano-rails'
  gem 'capistrano-rails-db'
  gem 'capistrano-rails-console'
  gem 'capistrano-upload-config'
  gem 'sshkit-sudo'

我在vidoe教程中提到了几个步骤,用于创建文件和deploy.erb的所有内容。

# config valid only for current version of Capistrano
lock '3.5.0'

set :repo_url, 'git@github.com:evercam/evercam-admin.git'
# ask :branch, `git rev-parse --abbrev-ref HEAD`.chomp

set :user, 'deployer'
set :application, 'evercam-admin'
set :rails_env, 'production'
server '88.99.226.17', user: "#{fetch(:user)}", roles: %w{app db web}, primary: true
set :deploy_to,       "/home/#{fetch(:user)}/apps/#{fetch(:application)}"
set :pty, true

set :linked_files, fetch(:linked_files, []).push('config/database.yml', 'config/secrets.yml', 'config/puma.rb')
set :linked_dirs, fetch(:linked_dirs, []).push('log', 'tmp/pids', 'tmp/cache', 'tmp/sockets', 'vendor/bundle', 'public/system', 'public/uploads')

set :config_example_suffix, '.example'
set :config_files, %w{config/database.yml config/secrets.yml}
set :puma_conf, "#{shared_path}/config/puma.rb"

namespace :deploy do
  before 'check:linked_files', 'config:push'
  before 'check:linked_files', 'puma:config'
  before 'check:linked_files', 'puma:nginx_config'
  after 'puma:smart_restart', 'nginx:restart'
end

成功部署之后,我的应用程序首先开始88.99.226.17并且我得到了低级错误,并且在日志中有关于secret_key_base的错误,我添加了并再次部署但现在应用程序甚至没有加载到该公共IP 。 Nginx日志很好,nginx的错误日志中没有任何内容,我的配置文件是https://github.com/evercam/evercam-admin/blob/master/config/deploy/templates/nginx_conf.erb

请帮助我已经花了很多时间在这上面。 。提前谢谢,

0 个答案:

没有答案