首页 > 解决方案 > Ruby Heroku Buildpack 因 Dokku 失败

问题描述

我有一个 Rails 应用程序,我定期在 Heroku 上部署并且总是成功,我正在尝试使用 Dokku 将它迁移到 Digital Ocean。在 Heroku 上,我只安装了 nodejs 和 Ruby buildpacks(按此顺序),我所做的就是推送它。所以,我想我会用 Dokku 图像创建一个数字海洋,添加相同的构建包,并能够推送我的应用程序,但在部署过程中它失败了。这是我在 Digital Ocean 上创建 Droplet 后所做的:

ssh-add -k ~/.ssh/id_rsa
ssh root@123.123.123.123 (IP address of the Droplet)
# Now I have SSH'd into the droplet
dokku apps:create mytestapp
dokku buildpacks:add mytestapp https://github.com/heroku/heroku-buildpack-nodejs.git
dokku buildpacks:add mytestapp https://github.com/heroku/heroku-buildpack-ruby.git
exit
# Now I've exited back into my local machine
git remote add dokku dokku@123.123.123.123:mytestapp
git push dokku master

这是我推送后得到的输出:

Enumerating objects: 15825, done.
Counting objects: 100% (15825/15825), done.
Delta compression using up to 12 threads
Compressing objects: 100% (8331/8331), done.
Writing objects: 100% (15825/15825), 2.14 MiB | 7.52 MiB/s, done.
Total 15825 (delta 11885), reused 9604 (delta 7204)
remote: Resolving deltas: 100% (11885/11885), done.
-----> Cleaning up...
-----> Building mytestapp from herokuish...
-----> Adding BUILD_ENV to build environment...
-----> Warning: Multiple default buildpacks reported the ability to handle this app. The first buildpack in the list below will be used.
       Detected buildpacks: multi ruby nodejs
-----> Multipack app detected
=====> Downloading Buildpack: https://github.com/heroku/heroku-buildpack-nodejs.git
=====> Detected Framework: Node.js

-----> Creating runtime environment

       NPM_CONFIG_LOGLEVEL=error
       USE_YARN_CACHE=true
       NODE_ENV=production
       NODE_MODULES_CACHE=true
       NODE_VERBOSE=false


... (bunch of nodejs output and then succeeds)


=====> Downloading Buildpack: https://github.com/heroku/heroku-buildpack-ruby.git
=====> Detected Framework: Ruby
       Failed to download a Ruby executable for bootstrapping!

       This is most likely a temporary internal error. If the problem
       persists, make sure that you are not running a custom or forked
       version of the Heroku Ruby buildpack which may need updating.

       url: https://s3-external-1.amazonaws.com/heroku-buildpack-ruby/production/ruby-2.6.6.tgz
remote: /tmp/buildpackuip6D/bin/compile: line 31: /tmp/tmp.zjpwB97bqO/bin/ruby: No such file or directory
To 123.123.123.123:mytestapp
 ! [remote rejected] master -> master (pre-receive hook declined)

它似乎无法下载 Ruby buildpack,但下载 Node buildpack 的第一步完成得很好。这些与 Heroku 使用的构建包相同,我也可以curl在本地机器上使用 Ruby 构建包curl https://s3-external-1.amazonaws.com/heroku-buildpack-ruby/production/ruby-2.6.6.tgz -o file。使用 Dokku 从 Heroku 切换到 Digital Ocean 似乎应该很容易。有人可以帮我弄清楚我做错了什么吗?

标签: ruby-on-railsherokudigital-oceandokku

解决方案


推荐阅读