Giter VIP home page Giter VIP logo

Comments (8)

allait avatar allait commented on June 2, 2024 1

I had the same issue and here's what worked for me:

  1. Adding :min-lein-version "2.0.0" to project.clj
  2. Creating a Procfile with web: lein ring server

This was enough to make the app run on Heroku and I've made no other changes to the template except uncommenting the code in core.clj and web.clj. This Procfile is probably not the best way to do this, since ring docs mention that lein ring server starts a development server. I've tried replacing it with web: lein with-profile production trampoline ring server-headless and it still works, but I'm not sure if it's in any way better.

from curriculum.

selasiehanson avatar selasiehanson commented on June 2, 2024

Has anyone solved this?

from curriculum.

bridgethillyer avatar bridgethillyer commented on June 2, 2024

This has not been solved, and I don't know that anyone has reproduced it yet, either.

from curriculum.

selasiehanson avatar selasiehanson commented on June 2, 2024

Is there a Procfile that needs to be added to deploy to heroku and if so how does it look like. I'm new to clojure but with my experiences with nodejs, I always added a procfile to my node apps.

from curriculum.

kariannemah avatar kariannemah commented on June 2, 2024

Hi @kwistens , @bridgethillyer, and @selasiehanson,

I wrote the docs for Heroku deployment, and I'm getting an application error too.

A Procfile isn't necessary in most languages, since Heroku can figure out what language you're using and create a default web process type to start the application server.

But a Procfile does provide more control over deployment, and given the error here without one, I'm trying various iterations of the Procfile as recommended here. Here are a couple:

  • web: lein with-profile production trampoline run -m global_growth.web
  • adding :uberjar-name "global-growth-standalone.jar" to project.clj
    and creating a Procfile with the following:
    web: java $JVM_OPTS -cp target/global-growth-standalone.jar clojure.main -m global_growth.web

For the latter, I get this log error: Exception in thread "main" java.lang.Exception: Cannot find anything to run for: global_growth.web This makes sense since there isn't a function called main in web.clj. I also tried deploying with clojure.main-page and clojure.main-routes instead of clojure.main. No dice.

I haven't had success yet. Perhaps someone with more robust knowledge of the JVM can help?

from curriculum.

kariannemah avatar kariannemah commented on June 2, 2024

Thanks, @allait!

Your comments, along with this, were very helpful.

Here's what worked for me. Almost identical to yours, but it includes a slight modification to the Procfile:

  1. Add :min-lein-version "2.0.0" to project.clj
  2. Create a Procfile with web: lein ring server-headless $PORT

I will update the docs accordingly.

from curriculum.

k4y3ff avatar k4y3ff commented on June 2, 2024

Looks like this issue was resolved a long while ago, but the issue remains open.

Closing it now!

from curriculum.

kariannemah avatar kariannemah commented on June 2, 2024

@kpfell 👍 Thanks! Hope all is well.

from curriculum.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.