无法部署生产Capistrano

时间:2018-06-28 20:03:42

标签: ruby-on-rails ruby-on-rails-5 capistrano3

我正在尝试使用capistrano部署我的应用程序,我已将代码推送到GitHub,但是,我得到了以下内容

ben@ben-VirtualBox:~/Desktop/pol-v2$ cap production deploy
Stage not set, please call something such as `cap production deploy`, where production is a stage you have defined.

这就是我的Capfile中的内容

require "capistrano/setup"
require "capistrano/deploy"

require "capistrano/scm/git"
install_plugin Capistrano::SCM::Git

require "capistrano/rbenv"
require "capistrano/rails/assets"
require "capistrano/rails/migrations"
require "capistrano/passenger"

set :rbenv_type, :user
set :rbenv_ruby, '2.5.1'

Dir.glob("lib/capistrano/tasks/*.rake").each { |r| import r }

这是我的deploy.rb

lock "~> 3.11.0"

set :application, "pol_v2"
set :repo_url, "REPO LINK"
set :deploy_to, "DEPLOY PATH"

append :linked_files, "config/database.yml"
append :linked_dirs, "log", "tmp/pids", "tmp/cache", "tmp/sockets", "public/system"

set :keep_releases, 3

production.rb

set :stage, :production
server "IP", user: "USER", roles: %w{app db web}

1 个答案:

答案 0 :(得分:0)

我猜这行set :stage, :production应该是set :rails_env, :production