1

这是我的deploy.rb

set :application, "admin"
set :repository,  "here is my bitbucket repository"

set :scm, :git
# Or: `accurev`, `bzr`, `cvs`, `darcs`, `git`, `mercurial`, `perforce`, `subversion` or `none`
set :branch, "master"

set :rails_env, "production"

set :deploy_via, :copy

set :ssh_options, { forward_agent: true, port: 2020 }

set :keep_releases, 5

server "admin.mydomain.com", :app, :web, :db, primary: true

set :deploy_to "/var/www/vhosts/admin"

我已经提到了配置 capistrano 的两个链接

链接 1链接 2

当我跑步时cap deploy:setup

我收到错误

cap aborted!
cannot load such file -- deploy
/home/seting/Documents/site/admin/Capfile:1:in `load'
/home/seting/Documents/site/admin/Capfile:1:in `<top (required)>'
/home/seting/.rvm/gems/ruby-2.0.0-p247/gems/capistrano-3.0.0/lib/capistrano/application.rb:22:in `load_rakefile'
/home/seting/.rvm/gems/ruby-2.0.0-p247/gems/capistrano-3.0.0/lib/capistrano/application.rb:12:in `run'
/home/seting/.rvm/gems/ruby-2.0.0-p247/gems/capistrano-3.0.0/bin/cap:3:in `<top (required)>'
/home/seting/.rvm/gems/ruby-2.0.0-p247/bin/cap:23:in `load'
/home/seting/.rvm/gems/ruby-2.0.0-p247/bin/cap:23:in `<main>'
/home/seting/.rvm/gems/ruby-2.0.0-p247/bin/ruby_noexec_wrapper:14:in `eval'
/home/seting/.rvm/gems/ruby-2.0.0-p247/bin/ruby_noexec_wrapper:14:in `<main>'
(See full trace by running task with --trace)

编辑 1

这是我的帽子文件

load 'deploy'
# Uncomment if you are using Rails' asset pipeline
     load 'deploy/assets'
Dir['vendor/gems/*/recipes/*.rb','vendor/plugins/*/recipes/*.rb'].each { |plugin| load(plugin) }
load 'config/deploy' # remove this line to skip loading any of the default tasks
4

3 回答 3

5

如果你使用 RVM >= 1.11.3,你应该将rvm-capistranogem 添加到你的 Gemfile 中,然后bundle install.

于 2013-10-23T18:42:53.197 回答
0

它应该是

cap deploy:setup

不是

cap:deploy:setup
于 2013-10-10T18:12:21.257 回答
0

在您的 capfile 的第 1 行,而不是

load 'deploy'

利用

load 'deploy' if respond_to?(:namespace)
于 2013-10-23T09:56:09.773 回答