[英]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.