【问题标题】:WARN [SKIPPING] No Matching Host for /usr/bin/env touch /srv/yenta/releases/20140411230746/tmp/restart.txtWARN [SKIPPING] /usr/bin/env touch /srv/yenta/releases/20140411230746/tmp/restart.txt 没有匹配的主机
【发布时间】:2014-04-11 23:13:20
【问题描述】:

我正在使用 capistrano 3。我的 rails 4.0 应用程序中没有 tmp/restart.txt 文件。当我部署我的应用程序时,我收到此错误:

WARN [SKIPPING] No Matching Host for /usr/bin/env touch /srv/yenta/releases/20140411230746/tmp/restart.txt

在部署的服务器中,应用没有 tmp/restart.txt。我想知道我是否应该明确地创建一个任务,或者我是否缺少 capistrano 中的任何设置。在 capistrano 2 中,我将创建一个任务来明确地触摸 tmp/restart.txt 文件。

感谢任何帮助!

【问题讨论】:

    标签: ruby-on-rails passenger capistrano3


    【解决方案1】:

    此问题源于未定义特定角色 - 代码使用 :app 角色而未定义该角色,这导致找不到主机问题。

    部署.rb

    desc 'Restart application'
    task :restart do
      on roles(:app), in: :sequence, wait: 5 do
        # Your restart mechanism here, for example:
        execute :touch, current_path.join('tmp/restart.txt')
      end
    end
    

    部署/staging.rb

    role  :web,       "qa4-yenta"
    set   :deploy_to, "/srv/yenta"
    set   :rails_env, "staging"
    set   :user,      "yenta"
    set   :use_sudo,  false
    set   :branch,    "staging"
    set   :deploy_via, :remote_cache
    

    :app 角色需要更改为:web,或者需要定义:app 角色。

    【讨论】:

    • 注意:我有来源 =)
    【解决方案2】:

    您尝试在releases 文件夹中使用touch - 您需要在current 文件夹中执行此操作。

    是的,没有tmp/restart.txt。有人告诉我你必须创建它,但我们使用的乘客版本 (4) 似乎只是重新启动应用程序?

    【讨论】:

      【解决方案3】:

      此错误通常意味着它找不到任何匹配的主机来执行此任务。

      重新启动乘客的任务是什么?您为此任务指定了哪些角色?

      如果您能在此处提供您的重启任务代码会有所帮助。

      作为参考,请查看此博客,了解如何设置更新当前文件夹的重启任务:http://robmclarty.com/blog/how-to-deploy-a-rails-4-app-with-git-and-capistrano

      查看第 4 步。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2016-03-23
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2013-07-16
        • 2011-07-29
        • 2016-02-20
        • 1970-01-01
        相关资源
        最近更新 更多