3

我正在使用 capistrano 3.0.1 和 capistrano-rails 1.1.0 进行部署。到目前为止,部署运行良好,只是assets:precompile没有执行。每次都会使用此消息跳过该阶段:

WARN [SKIPPING] No Matching Host for /usr/bin/env if test ! -d /var/www/versioneye/releases/20140111161403; then echo "Directory does not exist '/var/www/versioneye/releases/20140111161403'" 1>&2; false; fi
 WARN [SKIPPING] No Matching Host for bundle exec rake assets:precompile
 WARN [SKIPPING] No Matching Host for /usr/bin/env if test ! -d /var/www/versioneye/releases/20140111161403; then echo "Directory does not exist '/var/www/versioneye/releases/20140111161403'" 1>&2; false; fi
 WARN [SKIPPING] No Matching Host for /usr/bin/env cp /var/www/versioneye/releases/20140111161403/public/assets/manifest* /var/www/versioneye/releases/20140111161403/assets_manifest_backup
 WARN [SKIPPING] No Matching Host for /usr/bin/env if test ! -d /var/www/versioneye/releases/20140111161403; then echo "Directory does not exist '/var/www/versioneye/releases/20140111161403'" 1>&2; false; fi
 WARN [SKIPPING] No Matching Host for /usr/bin/env find public/images public/javascripts public/stylesheets -exec touch -t 201401111614.03 {} ';'; true

我只定义了 1 个角色config/deploy/stagging

role :app, %w{cap@aws-7}

config/deploy.rb我这样设置asset_roles:

set :assets_roles, [:app]   # Defaults to [:web]

知道为什么不assets:precompile被执行吗?

4

3 回答 3

7

没有匹配的主机可能意味着您没有为该角色设置主机。我也是走捷径,只填了role :app,然后有这个问题,填了role :web,还是有问题,填了role :db,就可以成功部署了,包括每次写crontab。

role :app %w{cap@aws-7}
role :web %w{cap@aws-7}
role :db  %w{cap@aws-7}

其中 cap@aws-7 是您的 deployuser@hostname.com

于 2014-02-12T21:52:29.433 回答
1

不知何故 assets_roles 在我的情况下没有任何影响。在我明确设置其中的网络角色后,config/deploy/stagging它就起作用了。

role :web, %w{cap@aws-7}
于 2014-01-11T16:51:34.433 回答
0

更新到 capistrano-rails 1.1.1

capistrano-rails 1.1.0没有 'set :assets_roles..' 功能。

于 2014-09-20T07:48:17.137 回答