Heroku Clojure Deloyment的初级Qs [英] Beginner Qs on Heroku Clojure Deloyment
问题描述
我试图在Heroku的Cedar堆栈上运行Compojure / Ring应用程序(但失败,显然:)。我已遵循这些指南
首先,我部署B),然后似乎成功地引出了一个网络动态C)。但我没有看到任何东西,当我的应用程序的URL。运行heroku ps显示正在运行的进程,但我无法从Web访问我的应用程序。什么特别是我失踪?我需要使用git的主分支吗?如果我使用lein run在我的Procfile(我试过几个命令),Heroku(或工头)如何知道运行哪个HTTP处理程序(再次Compojure / Ring应用程序)?
B)
$ git push heroku
计数对象:4,完成。
压缩对象:100%(2/2),完成。
编写对象:100%(3/3),293字节,完成。
总计3(delta 1),重用0(delta 0)
到git@heroku.com:high-night-9597.git
36e7c18..050ea6d account-chooser - >
$ heroku ps:scale web = 1
缩放Web进程...完成,现在运行1
D)
$ heroku ps
进程状态命令
------- ---------------- ---------
run.1 complete for 11m lein repl
web.1 created for 8m
E)
$ heroku运行lein repl
运行lein repl附加到终端... up,run.1
F)程序:
-web:lein exec src / .clj
+ web:lein run
提前感谢
解决方案您可以使用任何您喜欢的分支,但是您需要指定要推送到哪个分支heroku - 如果你不在那个分支已经:
$ git push heroku your_branch_name
如果您的应用程序在本地运行良好,Heroku知道如何根据您在Procfile中的运行它,
假设您的主处理程序位于
$ YOUR_APP_ROOT / src / my-clj-app / core.clj
。
然后,你的Procfile应该看起来像这样:
web:lein run -m my-clj-app.core
这是Heroku如何知道如何运行
确保该文件具有正确的命名空间定义:
(ns my-clj-app.core)
p>
I've tried to get a Compojure/Ring application running on Heroku's Cedar stack ( but failed, obviously, :). I've followed these guides
First, I deployed B), then seemed to successfully set off a web dyno C). But I don't see anything, when going to my app's URL. Running a heroku ps displayes the running processes, but I can't access my app from the web. Anything in particular I'm missing? Do I need to use git's master branch ? If I use lein run in my Procfile (I've tried several commands), how does Heroku (or foreman) know which http handler to run (again a Compojure/Ring app) ?
B)
$ git push heroku Counting objects: 4, done. Compressing objects: 100% (2/2), done. Writing objects: 100% (3/3), 293 bytes, done. Total 3 (delta 1), reused 0 (delta 0) To git@heroku.com:high-night-9597.git 36e7c18..050ea6d account-chooser ->
C)
$ heroku ps:scale web=1 Scaling web processes... done, now running 1
D)
$ heroku ps Process State Command ------- ---------------- --------- run.1 complete for 11m lein repl web.1 created for 8m
E)
$ heroku run lein repl Running lein repl attached to terminal... up, run.1
F) Procfile:
-web: lein exec src/.clj +web: lein run
Thanks in advance
You can use any branch you like, however you need to specify which branch you want to push to heroku - if you're not in that branch already:
$ git push heroku your_branch_name
Provided your app runs fine locally, Heroku knows how to run it based on what you have in your Procfile, which in your case seems to have something missing.
Say your main handler is under $YOUR_APP_ROOT/src/my-clj-app/core.clj
.
Then, your Procfile should probably look something like this:
web: lein run -m my-clj-app.core
That's how Heroku knows how to run your app.
Make sure that file has the correct namespace definition:
(ns my-clj-app.core)
Can you give that a try?
这篇关于Heroku Clojure Deloyment的初级Qs的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!