Search code examples
gitperlherokumojolicious

Heroku push rejected in Mojolicious full app


I'm creating a full Mojolicious 4.58 app and trying to deploy it to Heroku.

mojo generate app MyApp

To the root directory of the app, and according to https://github.com/judofyr/perloku, I've added a Makefile.PL

#!/usr/bin/env perl                          
use ExtUtils::MakeMaker;

WriteMakefile(
    NAME      => 'myapp.pl',
    VERSION   => '0.01',
    AUTHOR    => 'Shemahmforash',
    PREREQ_PM => { 'Mojolicious' => '4.58', }
);

and a Perloku executable file

#!/bin/sh                                                                                                                                                                                   
/script/my_app daemon -l http://*:$PORT -m production

If I try to run the Perloku in my machine, it works fine:

$ PORT=3000 ./Perloku
Server available at http://127.0.0.1:3000

Although, if I try to follow the heroku deploy process, https://devcenter.heroku.com/articles/git, it rejects my push:

$ git init
 Initialized empty Git repository in /home/wanderer/Code/perl/mojolicious/heroku/my_app/.git/

$ git add .

$ git commit -m "my first commit"
[master (root-commit) dd91c47] my first commit
 10 files changed, 86 insertions(+)
 create mode 100644 Makefile.PL
 create mode 100755 Perloku
 create mode 100644 lib/MyApp.pm
 create mode 100644 lib/MyApp/Example.pm
 create mode 100644 log/production.log
 create mode 100644 public/index.html
 create mode 100755 script/my_app
 create mode 100644 t/basic.t
 create mode 100644 templates/example/welcome.html.ep
 create mode 100644 templates/layouts/default.html.ep

$ heroku create
 Creating floating-scrubland-3717... done, stack is cedar
 http://floating-scrubland-3717.herokuapp.com/ | git@heroku.com:floating-scrubland-3717.git
 Git remote heroku added

$ git push heroku master
 Enter passphrase for key '/home/wanderer/.ssh/id_rsa': 
 Counting objects: 21, done.
 Delta compression using up to 4 threads.
 Compressing objects: 100% (14/14), done.
 Writing objects: 100% (21/21), 2.44 KiB, done.
 Total 21 (delta 0), reused 0 (delta 0)


 !     Push rejected, no Cedar-supported app detected

 To git@heroku.com:floating-scrubland-3717.git
 ! [remote rejected] master -> master (pre-receive hook declined)
 error: failed to push some refs to 'git@heroku.com:floating-scrubland-3717.git'

Note that if I try to follow the same procedure using a mojolicious lite app, it works fine!

Thanks for your help.


Solution

  • You need to create your Heroku instance like this

    heroku create -s cedar --buildpack http://github.com/judofyr/perloku.git