2

I'm attempting to recreate a minimal example of a Dancer app deployed on Heroku as demonstrated by deploying-a-dancer-app-on-heroku.md Unfortunately, my deployment is failing with the installation of cpanm, and specifically version.

Here are the exact commands that I'm running on Strawberry Perl 5.18.2, Windows 7:

  • cd C:\tmp
  • dancer -a myheroku
    + myheroku
    + myheroku\bin
    + myheroku\bin\app.pl
    + myheroku\MANIFEST.SKIP
    + myheroku\public
    + myheroku\public\404.html
    + myheroku\public\images
    + myheroku\public\dispatch.cgi
    + myheroku\public\css
    + myheroku\public\css\error.css
    + myheroku\public\css\style.css
    + myheroku\public\500.html
    + myheroku\public\javascripts
    + myheroku\public\javascripts\jquery.js
    + myheroku\public\dispatch.fcgi
    + myheroku\Makefile.PL
    + myheroku\t
    + myheroku\t\001_base.t
    + myheroku\t\002_index_route.t
    + myheroku\views
    + myheroku\views\layouts
    + myheroku\views\layouts\main.tt
    + myheroku\views\index.tt
    + myheroku\lib
      myheroku\lib
    + myheroku\lib\myheroku.pm
    + myheroku\config.yml
    + myheroku\environments
    + myheroku\environments\production.yml
    + myheroku\environments\development.yml

Then in Git Bash, I do the following:

  • cd myheroku/
  • git init
  • git add .
  • git update-index --chmod=+x bin/app.pl
  • git commit -a -m "Dancer on Heroku"
    [master (root-commit) ced2e50] Dancer on Heroku
     22 files changed, 813 insertions(+)
     create mode 100644 MANIFEST
     create mode 100644 MANIFEST.SKIP
     create mode 100644 Makefile.PL
     create mode 100755 bin/app.pl
     create mode 100644 config.yml
     create mode 100644 environments/development.yml
     create mode 100644 environments/production.yml
     create mode 100644 lib/myheroku.pm
     create mode 100644 public/404.html
     create mode 100644 public/500.html
     create mode 100644 public/css/error.css
     create mode 100644 public/css/style.css
     create mode 100644 public/dispatch.cgi
     create mode 100644 public/dispatch.fcgi
     create mode 100644 public/favicon.ico
     create mode 100644 public/images/perldancer-bg.jpg
     create mode 100644 public/images/perldancer.jpg
     create mode 100644 public/javascripts/jquery.js
     create mode 100644 t/001_base.t
     create mode 100644 t/002_index_route.t
     create mode 100644 views/index.tt
     create mode 100644 views/layouts/main.tt
    Miller@NEWTON /c/tmp/myheroku (master)
  • heroku create --stack cedar --buildpack http://github.com/damog/heroku-buildpack-perl.git (link to buildpack)
    Creating serene-mountain-6144... done, stack is cedar
    BUILDPACK_URL=http://github.com/damog/heroku-buildpack-perl.git
    http://serene-mountain-6144.herokuapp.com/ | git@heroku.com:serene-mountain-6144.git
    Git remote heroku added
    Miller@NEWTON /c/tmp/myheroku (master)
  • git push heroku master
    Enter passphrase for key '/c/Users/Miller/.ssh/id_rsa':
    Initializing repository, done.
    Counting objects: 34, done.
    Delta compression using up to 4 threads.
    Compressing objects: 100% (30/30), done.
    Writing objects: 100% (34/34), 40.71 KiB, done.
    Total 34 (delta 3), reused 0 (delta 0)

    -----> Fetching custom git buildpack... done
    -----> Perl/PSGI Dancer! app detected
    -----> Bootstrapping cpanm
           Successfully installed version-0.9908 (upgraded from 0.77)
           ! Installing the dependencies failed: Installed version (0.77) of version is not in range '0.87'
           ! Bailing out the installation for Module-Metadata-1.000019.
           Successfully installed Scalar-List-Utils-1.38 (upgraded from 1.21)
           Successfully installed JSON-PP-2.27203
           Successfully installed Test-Simple-1.001003 (upgraded from 0.92)
           Successfully installed CPAN-Meta-YAML-0.012
           Successfully installed Parse-CPAN-Meta-1.4414 (upgraded from 1.39)
           Successfully installed CPAN-Meta-Requirements-2.125
           ! Installing the dependencies failed: Installed version (1.21) of List::Util is not in range '1.33', Installed version (0.77) of version is not in range'0.88'
           ! Bailing out the installation for CPAN-Meta-2.140640.
           Successfully installed Perl-OSType-1.007
           Successfully installed ExtUtils-CBuilder-0.280216 (upgraded from 0.2602)
           Successfully installed ExtUtils-ParseXS-3.24 (upgraded from 2.2002)
           ! Installing the dependencies failed: Module 'Module::Metadata' is not installed, Module 'CPAN::Meta' is not installed, Installed version (0.77) of version is not in range '0.87'
           ! Bailing out the installation for Module-Build-0.4205.
           ! Installing the dependencies failed: Installed version (0.340201) of Module::Build is not in range '0.36'
           ! Bailing out the installation for App-cpanminus-1.7001.
           10 distributions installed
    -----> Installing dependencies
           /tmp/buildpack_24863d3e-f650-49e3-b75b-3ec1285e3ded/bin/compile: 30: ./local/bin/cpanm: not found
    -----> Installing Starman
           /tmp/buildpack_24863d3e-f650-49e3-b75b-3ec1285e3ded/bin/compile: 33: ./local/bin/cpanm: not found
    -----> Discovering process types
           Procfile declares types             -> (none)
           Default types for Perl/PSGI Dancer! -> web

    -----> Compressing... done, 428K
    -----> Launching... done, v5
           http://serene-mountain-6144.herokuapp.com/ deployed to Heroku

    To git@heroku.com:serene-mountain-6144.git
     * [new branch]      master -> master
    Miller@NEWTON /c/tmp/myheroku (master)

As you can see in the above results, cpanm attempts to upgrade version, claims it's successful, but then immediately claims that it's not successful and barfs. The relevant lines of the compile directives are:

if ! [ -e $BUILD_DIR/local/bin/cpanm ]; then
  echo "-----> Bootstrapping cpanm"
  curl --silent https://raw.github.com/miyagawa/cpanminus/master/cpanm | perl - App::cpanminus 2>&1 | indent
fi

Would appreciate if anyone could help me figure out where I'm going wrong with this minimal build pack, or where I can find some different working instructions for installing a Dancer App. Google has yet to receive any other options.

Len Jaffe
  • 3,442
  • 1
  • 21
  • 28
Miller
  • 34,962
  • 4
  • 39
  • 60
  • What's in your MakeFile.pl and your cpanfile? Have you made any modifications whatsoever to this data, or is it completely default? – Casao Apr 29 '14 at 12:38
  • This was my attempt to duplicate the minimal example, so it's 100% default from the call to `dancer -a myheroku` – Miller Apr 29 '14 at 12:40
  • I actually just tried this and didn't even get a working cpanm instance. Try using Miyagawa's original build pack -- change the url to https://github.com/miyagawa/heroku-buildpack-perl for the build-pack. – Casao Apr 29 '14 at 12:53
  • Attempted. Error is: `Push rejected, no Cedar-supported app detected`. Will try adding an `app.psgi` – Miller Apr 29 '14 at 13:04
  • That's what I had to do as well -- after doing that, it gave me the same error about cpanm. I'm not entirely familiar with Heroku, but it sounds like something to raise to their support/the build pack creators. – Casao Apr 29 '14 at 13:07

1 Answers1

0

I suspect your system's Perl modules are being detected before the ones newly installed by cpanm. See where cpanm's modules are being installed, and set your environment variable PERL5LIB to try those directories first, before running "git push heroku master."