所以我的應用程式突然停止作業,經過調查,問題似乎是由于在部署應用程式時沒有正確安裝傳單,這是因為基本上 Heroku 不支持 gdal。我在構建應用程式時遇到的錯誤是checking for gdal-config... no.
我去了 R buildpack 的 GitHub ( https://github.com/virtualstaticvoid/heroku-buildpack-r ),它說我需要容器化應用程式,所以我做了。
我做了以下鏈接(https://github.com/virtualstaticvoid/heroku-docker-r)中所說的,并在我的 dockerfile 中添加了一些命令,因此我的 docker 檔案如下所示:
FROM virtualstaticvoid/heroku-docker-r:shiny
ENV PORT=8080
RUN apt-get update &&\
apt-get install -y libcurl4-openssl-dev libssl-dev binutils libproj-dev proj-bin libgdal-dev gdal-bin
CMD ["/usr/bin/R", "--no-save", "--gui-none", "-f", "/app/run.R"]
可悲的是,我仍然遇到同樣的錯誤。此外,我無法下載 openssl 模塊,也不知道如何實作/嘗試我在網上找到的一些答案:
Using PKG_CFLAGS=
--------------------------- [ANTICONF] --------------------------------
Configuration failed because openssl was not found. Try installing:
* deb: libssl-dev (Debian, Ubuntu, etc)
* rpm: openssl-devel (Fedora, CentOS, RHEL)
* csw: libssl_dev (Solaris)
* brew: openssl@1.1 (Mac OSX)
If openssl is already installed, check that 'pkg-config' is in your
PATH and PKG_CONFIG_PATH contains a openssl.pc file. If pkg-config
is unavailable you can set INCLUDE_DIR and LIB_DIR manually via:
R CMD INSTALL --configure-vars='INCLUDE_DIR=... LIB_DIR=...'
-------------------------- [ERROR MESSAGE] ---------------------------
tools/version.c:1:10: fatal error: openssl/opensslv.h: No such file or directory
1 | #include <openssl/opensslv.h>
| ^~~~~~~~~~~~~~~~~~~~
compilation terminated.
我需要幫助。
編輯:
我認為問題來自這樣一個事實,即我在從 docker 構建映像后安裝了庫(此映像安裝 R 而不安裝 libgdal、gdal-config、... 包),因此需要在 FROM 陳述句之前安裝這些庫或者我需要構建自己的影像(不知道如何),或者該人需要更新他的影像以使其支持 gdal 和 openssl。
uj5u.com熱心網友回復:
正如您所猜測的,問題是在libgdal-dev安裝rgdalR 包之前沒有安裝依賴項。
heroku-docker-r使用“Aptfile”對此進行規定以指定要安裝的依賴項(根據檔案中具有附加依賴項的應用程式)。
我創建了一個示例專案heroku-docker-r-rgdal-example來展示如何使用所需的檔案等來構建專案。
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/368180.html
上一篇:docker其中一個容器立即關閉
