首页 文章

使用AZK的Rails应用程序部署在Digital Ocean上失败

提问于
浏览
1

我正在尝试在DigitalOcean Droplet上推送一个非常简单的rails应用程序 . 不幸的是,我可以继续部署:我遇到了一个非常难以捉摸的错误消息:

info: [agent] get agent status
info: [agent] agent is running: true
info: [agent] get agent status
info: [agent] agent is running: true
info: [agent] get agent status
info: [agent] agent is running: true
info: [agent] get agent status
info: [agent] agent is running: true
info: Connecting to http://192.168.50.4:2375

PLAY [all] *********************************************************************

TASK [setup] *******************************************************************
fatal: [default]: FAILED! => {"changed": false, "failed": true, "module_stderr": "", "module_stdout": "/bin/sh: 1: /usr/bin/python: not found\r\n", "msg": "MODULE FAILURE", "parsed": false}

NO MORE HOSTS LEFT *************************************************************
    to retry, use: --limit @playbooks/setup.retry

PLAY RECAP *********************************************************************
default                    : ok=0    changed=0    unreachable=0    failed=1

我是唯一一个遇到过这个问题的人吗?

这也是我的Azkfile:

/**
 * Documentation: http://docs.azk.io/Azkfile.js
 */
// Adds the systems that shape your system
systems({
    'apptelier-website': {
        // Dependent systems
        depends: [],
        // More images:  http://images.azk.io
        image: {docker: 'azukiapp/ruby:2.3.0'},
        // Steps to execute before running instances
        provision: [
            "bundle install --path /azk/bundler"
        ],
        workdir: "/azk/#{manifest.dir}",
        shell: "/bin/bash",
        command: ["bundle", "exec", "rackup", "config.ru", "--pid", "/tmp/ruby.pid", "--port", "$HTTP_PORT", "--host", "0.0.0.0"],
        wait: 20,
        mounts: {
            '/azk/#{manifest.dir}': sync("."),
            '/azk/bundler': persistent("./bundler"),
            '/azk/#{manifest.dir}/tmp': persistent("./tmp"),
            '/azk/#{manifest.dir}/log': path("./log"),
            '/azk/#{manifest.dir}/.bundle': path("./.bundle")
        },
        scalable: {"default": 1},
        http: {
            domains: [
                '#{env.HOST_DOMAIN}',                   // used if deployed
                '#{env.HOST_IP}',                       // used if deployed
                '#{system.name}.#{azk.default_domain}' // default azk domain
            ]
        },
        ports: {
            // exports global variables
            http: "3000/tcp"
        },
        envs: {
            // Make sure that the PORT value is the same as the one
            // in ports/http below, and that it's also the same
            // if you're setting it in a .env file
            RUBY_ENV: "production",
            RAILS_ENV: "production",
            RACK_ENV: 'production',
            WORKER_RETRY: 1,
            BUNDLE_APP_CONFIG: '/azk/bundler',
            APP_URL: '#{system.name}.#{azk.default_domain}'
        }
    },
    deploy: {
        image: {docker: 'azukiapp/deploy-digitalocean'},
        mounts: {
            '/azk/deploy/src': path('.'),
            '/azk/deploy/.ssh': path('#{env.HOME}/.ssh'), // Required to connect with the remote server
            '/azk/deploy/.config': persistent('deploy-config')
        },
        // This is not a server. Just run it with `azk deploy`
        scalable: {default: 0, limit: 0},
        envs: {
            GIT_REF: 'master',
            AZK_RESTART_COMMAND: 'azk restart -Rvv',
            BOX_SIZE: '512mb'
        }
    }
});

谢谢您的帮助 !

1 回答

  • 2

    爱德华,很高兴认识你 . 我来自 azk 核心团队,我使用最新的部署映像 .

    请按照以下步骤进行更新:

    • adocker pull azukiapp/deploy-digitalocean:0.0.7 ;

    • 编辑Azkfile中的 deploy 系统,并将标记 0.0.7 添加到使用的部署映像中,以确保我们使用的是最新版本 . 应该是这样的: image: {docker: 'azukiapp/deploy-digitalocean:0.0.7'} ;

    接下来,请确保在 .env 文件中设置了env DEPLOY_API_TOKEN . 如果你没有在DigitalOcean社区教程上发表过https://www.digitalocean.com/community/tutorials/how-to-deploy-a-rails-app-with-azk#step-7-%E2%80%94-obtaining-a-digitalocean-api-token

    最后,重新运行deploy命令:

    • azk deploy clear-cache ;

    • azk deploy

    如果这足以解决您的问题,请告诉我 .

相关问题