epsanchezma / exrm-heroku

Publish your Elixir releases to Heroku with ease.
MIT License
45 stars 4 forks source link

Failed to execute after_package hook for Elixir.ReleaseManager.Plugin.Heroku! #2

Open sheharyarn opened 9 years ago

sheharyarn commented 9 years ago

I'm trying to release my first elixir-phoenix app on heroku. I'm getting this error:

Psycho@MBP ~/code/elixir/nuclearn [master]
± % mix release --heroku                                                                                                                                
Compiled lib/nuclearn.ex
Compiled web/plugs/loaders.ex
Compiled lib/nuclearn/repo.ex
Compiled web/web.ex
Compiled web/models/video.ex
Compiled web/models/topic.ex
Compiled web/models/subject.ex
Compiled web/views/error_view.ex
Compiled web/controllers/page_controller.ex
web/controllers/subject_controller.ex:5: warning: unused alias Topic
Compiled web/controllers/subject_controller.ex
Compiled web/router.ex
web/controllers/topic_controller.ex:5: warning: unused alias Subject
Compiled web/controllers/topic_controller.ex
Compiled web/views/layout_view.ex
Compiled lib/nuclearn/endpoint.ex
web/controllers/video_controller.ex:5: warning: unused alias Subject
web/controllers/video_controller.ex:6: warning: unused alias Topic
Compiled web/controllers/video_controller.ex
Compiled web/views/page_view.ex
Compiled web/views/subject_view.ex
Compiled web/views/topic_view.ex
Compiled web/views/video_view.ex
Generated nuclearn app
==> Building release with MIX_ENV=dev.
==> Generating relx configuration...
==> Generating sys.config...
==> Generating boot script...
==> Performing protocol consolidation...
==> Conform: Loading schema...
==> Conform: No schema found, conform will not be packaged in this release!
==> Generating Procfile...
==> Generating release...
/usr/local/bin/mix:2: syntax error before: '#'
/usr/local/bin/mix:2: syntax error before: '#'
/usr/local/bin/mix:2: syntax error before: '#'
/usr/local/bin/mix:2: syntax error before: '#'
/usr/local/bin/mix:2: syntax error before: '#'
/usr/local/bin/mix:2: syntax error before: '#'
/usr/local/bin/mix:2: syntax error before: '#'
/usr/local/bin/mix:2: syntax error before: '#'
/usr/local/bin/mix:2: syntax error before: '#'
==> Generating nodetool...
==> Unpacking release...
Executing: slug -dir /var/folders/7_/zy_r791d4439vxsy5vc9mwcm0000gn/T/nuclearn -app nuclearn -release
2015/06/22 22:04:22 Put : unsupported protocol scheme ""
Command executed, output: 
Initializing slug for /var/folders/7_/zy_r791d4439vxsy5vc9mwcm0000gn/T/nuclearn...done
Archiving /var/folders/7_/zy_r791d4439vxsy5vc9mwcm0000gn/T/nuclearn...done
Pushing /var/folders/7_/zy_r791d4439vxsy5vc9mwcm0000gn/T/slug798518250.tgz...
==> Packaging release...
==> Failed to execute after_package hook for Elixir.ReleaseManager.Plugin.Heroku!
** (UndefinedFunctionError) undefined function: ReleaseManager.Plugin.Heroku.after_package/1
    ReleaseManager.Plugin.Heroku.after_package(%{__struct__: ReleaseManager.Config, dev: false, env: :dev, erl: "", heroku: true, name: "nuclearn", package: "/Users/Psycho/code/elixir/nuclearn/rel/nuclearn/nuclearn-0.0.1.tar.gz", process_type: "web", relx_config: [{:lib_dirs, ['/usr/local/Cellar/elixir/1.0.4/lib', '/Users/Psycho/code/elixir/nuclearn/_build/dev']}, {:release, {:nuclearn, '0.0.1'}, [{:nuclearn, '0.0.1'}, :elixir, :iex, :sasl]}, {:include_erts, true}, {:include_src, false}, {:extended_start_script, true}, {:generate_start_script, false}, {:overlay, [{:mkdir, 'releases/0.0.1'}, {:copy, './sys.config', 'releases/0.0.1/sys.config'}, {:copy, './boot', 'bin/nuclearn'}]}], upgrade?: false, verbosity: :quiet, version: "0.0.1"})
    lib/mix/tasks/release.ex:265: anonymous fn/2 in Mix.Tasks.Release.execute_package_hooks/1
    (elixir) lib/enum.ex:1261: Enum."-reduce/3-lists^foldl/2-0-"/3
    lib/mix/tasks/release.ex:74: Mix.Tasks.Release.do_run/1
    (mix) lib/mix/cli.ex:55: Mix.CLI.run_task/2
skylerparr commented 9 years ago

same issue. Tried with a brand new "hello world" mix project. I also tried MIX_ENV=prod. Same exact error.

guilleiguaran commented 9 years ago

I'm working in a pure Elixir replacement lib that will remove the dependency from slug command that is causing those issues.

rsgrafx commented 9 years ago

+1 Same issue / Thanks for your hard work.

globalkeith commented 8 years ago

+1 same issue - is there anyway to integrate what you've done exlug, with this project?

sheharyarn commented 8 years ago

In the meanwhile, you guys can deploy using the Phoenix Buildpack for Heroku. There's even a full step-by-step tutorial in the official Phoenix Guides.

globalkeith commented 8 years ago

@sheharyarn thanks. Thats where I started, and just wanted to stop deploying source to production. Working through this I finally "got" something I'd totally missed. To be able to compile for production you need to compile on the same environment as production. So if you plan to build a release for heroku you'll need to build inside a container (or be working on a linux machine). That added an extra level of complexity I wasn't quite ready for, but I'm sure with some time and careful thought, this can be integrated into something like Vagrant or even better Otto using a virtual machine.