繁体   English   中英

如何在OpenShift上运行clojure

[英]How to run clojure on OpenShift

我正在尝试使用运行以下命令的clojure-cartridge在OpenShift上部署Clojure应用程序:

rhc app create myapp http://cartreflect-claytondev.rhcloud.com/github/openshift-cartridges/clojure-cartridge

我可以使用lein run在本地运行应用程序并查看http://localhost:8080/它按预期工作。 但是当我从OpenShift运行它时,我得到:服务暂时不可用。

当我做rhc tail我得到:

Downloading Leiningen to /var/lib/openshift/54a1a338fcf933fb93000106/clojure//home/self-installs/leiningen-2.5.0-standalone.jar now... % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 14.2M 100 14.2M 0 0 18.6M 0 --:--:-- --:--:-- --:--:-- 25.5M Could not transfer artifact lein-ring:lein-ring:pom:0.7.5 from/to clojars (https://clojars.org/repo/): Specified destination directory cannot be created: /.m2/repository/lein-ring/lein-ring/0.7.5 This could be due to a typo in :dependencies or network issues. If you are behind a proxy, try setting the 'http_proxy' environment variable.

我是Clojure和使用OpenShift的新手,所以我可能错过或误解了一些明显的东西。 但是对于出了什么问题的任何想法?

虽然这个错误我对OpenShift一无所知:

Specified destination directory cannot be created: /.m2/repository/lein-ring/lein-ring/0.7.5

强烈暗示$HOME环境变量在OpenShift中不可用。 lein将文件写入$HOME/.m2/repository/...所以如果$ HOME未设置它将导致上面的错误。 看起来OpenShift允许这样:

Setting Custom Environment Variables
Set one of more environment variables for an application with the following command:

$  hc env set <Variable>=<Value> <Variable2>=<Value2> -a App_Name

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM