Giter VIP home page Giter VIP logo

heroku-buildpack-elixir's Introduction

Heroku Buildpack for Elixir

Features

  • Easy configuration with elixir_buildpack.config file
  • Use prebuilt Elixir binaries
  • Allows configuring Erlang
  • If your app doesn't have a Procfile, default web task mix run --no-halt will be run.
  • Consolidates protocols
  • Hex and rebar support
  • Caching of Hex packages, Mix dependencies and downloads
  • Compilation procedure hooks through hook_pre_compile, hook_compile, hook_post_compile configuration

Version support

Note: you should choose an Elixir and Erlang version that are compatible with one another.

Cloud Native Support

This buildpack is not guaranteed to be Cloud Native compatible. The elixir-buildpack/cloud-native-buildpack is a buildpack that is actively under development and is designed specifically to follow the Cloud Native Buildpack conventions.

Usage

Create a Heroku app with this buildpack

heroku create --buildpack hashnuke/elixir

Set the buildpack for an existing Heroku app

heroku buildpacks:set hashnuke/elixir

Use the edge version of buildpack

The hashnuke/elixir buildpack contains the latest published version of the buildpack, but you can use the edge version (i.e. the source code in this repo) by running:

heroku buildpacks:set https://github.com/HashNuke/heroku-buildpack-elixir.git

When you decide to use the published or the edge version of the buildpack you should be aware that, although we attempt to maintain the buildpack for as many old Elixir and Erlang releases as possible, it is sometimes difficult since there's a matrix of 3 variables involved: Erlang version, Elixir version and Heroku stack. If your application cannot be updated for some reason and requires an older version of the buildpack then use a specific version of buildpack.

Use a specific version of buildpack

The methods above always use the latest version of the buildpack code. To use a specific version of the buildpack, choose a commit from the commits page. The commit SHA forms part of your buildpack url.

For example, if you pick the commit "883f33e10879b4b8b030753c13aa3d0dda82e1e7", then the buildpack url for your app would be:

https://github.com/HashNuke/heroku-buildpack-elixir.git#883f33e10879b4b8b030753c13aa3d0dda82e1e7

It is recommended to use a buildpack url with a commit SHA on production apps. This prevents the unpleasant moment when your Heroku build fails because the buildpack you use just got updated with a breaking change. Having buildpacks pinned to a specific version is like having your Hex packages pinned to a specific version in mix.lock.

Using Heroku CI

This buildpack supports Heroku CI.

  • To enable viewing test runs on Heroku, add tapex to your project.
  • To detect compilation warnings use the hook_compile configuration option set to mix compile --force --warnings-as-errors.

Elixir Releases

This buildpack can optionally build an Elixir release. The release build will be run after hook_post_compile.

WARNING: If you need to do further compilation using another buildpack, such as the Phoenix static buildpack, you probably don't want to use this option. See the Elixir release buildpack instead.

To build and use a release for an app called foo compiled with MIX_ENV=prod:

  1. Make sure elixir_version in elixir_buildpack.config is at least 1.9
  2. Add release=true to elixir_buildpack.config
  3. Use web: _build/prod/rel/foo/bin/foo start in your Procfile

NOTE: This requires the master version of the buildpack (or a commit later than 7d369c)

Configuration

Create a elixir_buildpack.config file in your app's root dir. The file's syntax is bash.

If you don't specify a config option, then the default option from the buildpack's elixir_buildpack.config file will be used.

Here's a full config file with all available options:

# Erlang version
erlang_version=18.2.1

# Elixir version
elixir_version=1.2.0

# Always rebuild from scratch on every deploy?
always_rebuild=false

# Create a release using `mix release`? (requires Elixir 1.9)
release=true

# A command to run right before fetching dependencies
hook_pre_fetch_dependencies="pwd"

# A command to run right before compiling the app (after elixir, .etc)
hook_pre_compile="pwd"

hook_compile="mix compile --force --warnings-as-errors"

# A command to run right after compiling the app
hook_post_compile="pwd"

# Set the path the app is run from
runtime_path=/app

# Enable or disable additional test arguments
test_args="--cover"

Migrating from previous build pack

the following has been deprecated and should be removed from elixir_buildpack.config:

# Export heroku config vars
config_vars_to_export=(DATABASE_URL)

Specifying Elixir version

  • Use prebuilt Elixir release
elixir_version=1.2.0
  • Use prebuilt Elixir branch, the branch specifier ensures that it will be downloaded every time
elixir_version=(branch master)

Specifying Erlang version

  • You can specify an Erlang release version like below
erlang_version=18.2.1

Specifying config vars to export at compile time

  • To set a config var on your heroku node you can exec from the shell:
heroku config:set MY_VAR=the_value

Other notes

  • Add your own Procfile to your application, else the default web task mix run --no-halt will be used.

  • Your application should build embedded and start permanent. Build embedded will consolidate protocols for a performance boost, start permanent will ensure that Heroku restarts your application if it crashes. See below for an example of how to use these features in your Mix project:

    defmodule MyApp.Mixfile do
      use Mix.Project
    
      def project do
        [app: :my_app,
         version: "0.0.1",
         build_embedded: Mix.env == :prod,
         start_permanent: Mix.env == :prod]
      end
    end
  • The buildpack will execute the commands configured in hook_pre_compile and/or hook_post_compile in the root directory of your application before/after it has been compiled (respectively). These scripts can be used to build or prepare things for your application, for example compiling assets.

  • The buildpack will execute the commands configured in hook_pre_fetch_dependencies in the root directory of your application before it fetches the application dependencies. This script can be used to clean certain dependencies before fetching new ones.

Development

Testing

To run tests

git clone https://github.com/HashNuke/heroku-buildpack-elixir
export BUILDPACK="$(pwd)/heroku-buildpack-elixir"
git clone https://github.com/jesseshieh/heroku-buildpack-testrunner
git clone https://github.com/jesseshieh/shunit2
export SHUNIT_HOME="$(pwd)/shunit2"
cd heroku-buildpack-testrunner
bin/run $BUILDPACK

See more info at https://github.com/jesseshieh/heroku-buildpack-testrunner/blob/master/README.md

Credits

© Akash Manohar under The MIT License. Feel free to do whatever you want with it.

heroku-buildpack-elixir's People

Contributors

anulman avatar axelson avatar burgestrand avatar ch4s3 avatar chrismcg avatar crowdhailer avatar ericmj avatar fivetanley avatar hashnuke avatar jayjun avatar jesseshieh avatar kayhide avatar lbarratt avatar ma2gedev avatar matthijsgroen avatar mikker avatar msz avatar mxhold avatar myobie avatar novaugust avatar oldhammade avatar pbm avatar seantanly avatar seivan avatar simonewebdesign avatar sinetris avatar szymon-jez avatar techgaun avatar tyler-eon avatar ventsislaf avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

heroku-buildpack-elixir's Issues

Configure build path

I'm trying to use this build-pack to deploy to heroku in a more uniq way and I'm running into some difficulty. Basically, we're storing our mobile react-native and phoenix code within the same repo at /mobile and /web respectively.

I forked this project and edited the compile script to include /web in the build_path, which made it compile, but now when heroku runs my procfile: web: cd web/ && mix phoenix.server, I get app[web.1]: bash: mix: command not found in my server logs.

Should I edit the cache_path and env_path variables in bin/compile to include the /web path to ensure that mix is available? Also, elixir is not available if I run bash on heroku in both the root and web directories.

Looking forward to everyones thoughts' and suggestions.

Override MIX_ENV

I can't get MIX_ENV to be overridden when deploying my Elixir app to Deis (http://deis.io). All other ENV variables can be exported, but MIX_ENV=prod is always set by default.

What am I doing wrong?

Could not find "rebar3" when starting process

I've been using the same buildpack config file for my Phoenix app, and suddenly the app failed to start on my staging server. The deploy is successful, but then errors when Heroku tries to start the server:

2016-08-24T17:39:22.238589+00:00 heroku[web.1]: Starting process with command `MIX_ENV=prod mix phoenix.server`
2016-08-24T17:39:26.118100+00:00 app[web.1]: Shall I install rebar3? (if running non-interactively, use: "mix local.rebar --force") [Yn] ** (Mix) Could not find "rebar3" to compile dependency :idna, please ensure "rebar3" is available
2016-08-24T17:39:26.115713+00:00 app[web.1]: Could not find "rebar3", which is needed to build dependency :idna
2016-08-24T17:39:26.115728+00:00 app[web.1]: I can install a local copy which is just used by Mix
2016-08-24T17:39:26.206034+00:00 heroku[web.1]: Process exited with status 1
2016-08-24T17:39:26.222993+00:00 heroku[web.1]: State changed from starting to crashed

mix.exs

defmodule MyApp.Mixfile do
  use Mix.Project

  def project do
    [app: :myapp,
     version: "0.0.1",
     elixir: "~> 1.2",
     elixirc_paths: elixirc_paths(Mix.env),
     compilers: [:phoenix, :gettext] ++ Mix.compilers,
     build_embedded: Mix.env == :prod,
     start_permanent: Mix.env == :prod,
     aliases: aliases(),
     deps: deps(),
     test_coverage: [tool: ExCoveralls],
     preferred_cli_env: ["coveralls": :test, "coveralls.detail": :test, "coveralls.post": :test, "coveralls.html": :test]]
  end

  # Configuration for the OTP application.
  #
  # Type `mix help compile.app` for more information.
  def application do
    [mod: {MyApp, []},
     applications: [:phoenix, :phoenix_pubsub, :phoenix_html, :cowboy, :logger, :gettext,
                    :phoenix_ecto, :postgrex, :comeonin, :timex, :bamboo]]
  end

  # Specifies which paths to compile per environment.
  defp elixirc_paths(:test), do: ["lib", "web", "test/support"]
  defp elixirc_paths(_),     do: ["lib", "web"]

  # Specifies your project dependencies.
  #
  # Type `mix help deps` for examples and options.
  defp deps do
    [{:phoenix, "1.2.1"},
     {:phoenix_pubsub, "1.0.0"},
     {:phoenix_ecto, "3.0.1"},
     {:postgrex, ">= 0.0.0"},
     {:phoenix_html, "2.6.0"},
     {:gettext, "0.11.0"},
     {:cowboy, "1.0.4"},
     {:comeonin, "2.5.2"},
     {:guardian, "0.12.0"},
     {:guardian_db, "0.7.0"},
     {:timex, "3.0.5"},
     {:bamboo, "0.7.0"},
     {:number, "0.4.2"},
     {:phoenix_live_reload, "1.0.5", only: :dev},
     {:mix_test_watch, "0.2.6", only: :dev},
     {:excoveralls, "0.5.5", only: :test}]
  end

  # Aliases are shortcuts or tasks specific to the current project.
  # For example, to create, migrate and run the seeds file at once:
  #
  #     $ mix ecto.setup
  #
  # See the documentation for `Mix` for more info on aliases.
  defp aliases do
    ["ecto.setup": ["ecto.create", "ecto.migrate", "run priv/repo/seeds.exs"],
     "ecto.reset": ["ecto.drop", "ecto.setup"],
     "test": ["ecto.create --quiet", "ecto.migrate", "test"]]
  end
end

elixir_buildpack.config

# Elixir version
elixir_version=1.3.0

# Always rebuild from scratch on every deploy?
always_rebuild=true

# ENV variables
config_vars_to_export=(DATABASE_URL HOST SENDGRID_KEY)

I can't see any changes in the buid log before and after the app started crashing; it says that rebar3 is installed:

-----> Installing rebar
* creating /app/.mix/rebar
* creating /app/.mix/rebar3

Any help will be greatly appreciated! Thanks!

Support post compile hook

For Phoenix, we would like to have a complete buildpack solution when we ship 1.0, which means we need to be able to build brunch assets after compile. I'm not sure where to start here, but @ericmj has some idea where we need to begin.

Error on 'git push heroku master'

I've successfully used this buildpack over the last week for this app: https://extrophus.herokuapp.com

I just started getting this error though:

Counting objects: 9, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (9/9), done.
Writing objects: 100% (9/9), 773 bytes | 0 bytes/s, done.
Total 9 (delta 7), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Fetching custom git buildpack... done
remote: -----> elixir app detected
remote: -----> Checking Erlang and Elixir versions
remote:        Will use the following versions:
remote:        * Stack cedar-14
remote:        * Erlang 17.2
remote:        * Elixir branch master
remote:        Will export the following config vars:
remote:        * Config vars DATABASE_URL
remote:        * MIX_ENV=prod
remote: -----> Stack changed, will rebuild
remote: -----> Fetching Erlang 17.2
remote: -----> Installing Erlang 17.2 (changed)
remote:
remote: -----> Fetching Elixir master
remote: -----> Installing Elixir master (changed)
remote: -----> Installing Hex
remote: 2015-06-21 01:58:12 URL:https://s3.amazonaws.com/s3.hex.pm/installs/1.0.0/hex.ez [262010/262010] -> "/app/.mix/archives/hex.ez" [1]
remote: * creating .mix/archives/hex.ez
remote: ** (MatchError) no match of right hand side value: {:error, :bad_directory}
remote:     (mix) lib/mix/tasks/archive.install.ex:68: Mix.Tasks.Archive.Install.install_archive/2
remote:     (mix) lib/mix/cli.ex:60: Mix.CLI.run_task/2
remote:     (elixir) lib/code.ex:363: Code.require_file/2
remote:
remote: -----> Installing rebar
remote: * creating .mix/rebar
remote: -----> Fetching app dependencies with mix
remote: Could not find hex, which is needed to build dependency :phoenix
remote: Shall I install hex? [Yn] ** (Mix) Could not find a SCM for dependency :phoenix from Trophus.Mixfile
remote:
remote:  !     Push rejected, failed to compile elixir app
remote:
remote: Verifying deploy...
remote:
remote: !   Push rejected to extrophus.
remote:
To https://git.heroku.com/extrophus.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/extrophus.git'

Library compiling fine locally, but failing on deploy

I'm using the latest buildpack (no config file) and in upgrading to the newest quantum version, it fails on deploy:

remote: -----> Compiling
remote: lib/quantum.ex:1: warning: redefining module Quantum
remote: lib/quantum/application.ex:1: warning: redefining module Quantum.Application
remote: ==> quantum
remote: Compiled lib/quantum/application.ex
remote: lib/quantum/executor.ex:1: warning: redefining module Quantum.Executor
remote: 
remote: == Compilation error on file lib/quantum/executor.ex ==
remote: ** (CompileError) lib/quantum/executor.ex:34: undefined function match/3
remote:     (stdlib) lists.erl:1337: :lists.foreach/2
remote:     (stdlib) erl_eval.erl:669: :erl_eval.do_apply/6
remote: 
remote: could not compile dependency :quantum, "mix compile" failed. You can recompile this dependency with "mix deps.compile quantum", update it with "mix deps.update quantum" or clean it with "mix deps.clean quantum"
remote: 
remote:  !     Push rejected, failed to compile elixir app
remote: 

I also opened an issue here: https://github.com/c-rack/quantum-elixir/issues/75

Any thoughts?

Could not start decimal and poolboy when using Ecto

I'm not entirely sure this is a bug or me missing something. If it's the wrong place for posting this, please let me know.

So while deploying an app to Heroku that uses a private dependency that I've built, which in turn has a dependency on Ecto, I'm getting the following error when the app is starting up.

2014-07-31T09:12:39.805136+00:00 app[web.1]: ** (Mix) Could not start application poolboy: could not find application file: poolboy.app

The same happens to Ecto's Decimal dependency.

I'm using the following Procfile to start the main app web: MIX_ENV=prod elixir -pa _build/prod/consolidated -S mix run --no-halt

Running this locally works fine and doing the compilation steps manually on Heroku also works. The only difference I've been able to discover between other dependencies is that Ecto marks Decimal and Poolboy as optional: true. Adding Decimal and Poolboy to my main application resolves the problem and the applications starts as expected but it is backwards to have those dependencies listed there.

Is this an issue with the buildpack or Ecto?

cc @ericmj

Deploy error

Log

Total 0 (delta 0), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote: 
remote: -----> elixir app detected
remote: -----> Checking Erlang and Elixir versions
remote:        Will use the following versions:
remote:        * Stack cedar-14
remote:        * Erlang 19
remote:        * Elixir 1.3.2 
remote:        Will export the following config vars:
remote:        * Config vars DATABASE_URL
remote:        * MIX_ENV=prod
remote: -----> Stack changed, will rebuild
remote: -----> Fetching Erlang 19
remote: -----> Installing Erlang 19 (changed)
remote: 
remote: gzip: stdin: not in gzip format
remote: tar: Child returned status 1
remote: tar: Error is not recoverable: exiting now
remote: /app/tmp/buildpacks/09ddb244532cda92940765f98f6660e7bc5527418f1f0bec19fa36c7a3b1de5286b8a46e789859c02bb3d9e0bb39cfb3ab65aa1ec02ea6b87a43bb46500f959d/lib/erlang_funcs.sh: line 37: /app/tmp/cache/erlang/Install: No such file or directory
remote: -----> Fetching Elixir v1.3.2
remote: -----> Installing Elixir v1.3.2 (changed)
remote: -----> Installing Hex
remote: /tmp/build_9534e1c220fe474350f275048d53a385/.platform_tools/elixir/bin/elixir: 126: exec: erl: not found
remote: -----> Installing rebar
remote: /tmp/build_9534e1c220fe474350f275048d53a385/.platform_tools/elixir/bin/elixir: 126: exec: erl: not found
remote: -----> Fetching app dependencies with mix
remote: /tmp/build_9534e1c220fe474350f275048d53a385/.platform_tools/elixir/bin/elixir: 126: exec: erl: not found
remote:  !     Push rejected, failed to compile elixir app.
remote: 
remote:  !     Push failed
remote: Verifying deploy...
remote: 
remote: !   Push rejected to soranus.
remote: 
To https://git.heroku.com/soranus.git
 ! [remote rejected] development -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/soranus.git'

elixir_buildpack.config

# Erlang version
erlang_version=19

# Elixir version
elixir_version=1.3.2

# Always rebuild from scratch on every deploy?
always_rebuild=false

# Export heroku config vars
# config_vars_to_export=(DATABASE_URL)

# A command to run right before compiling the app (after elixir, .etc)
# pre_compile="pwd"

# A command to run right after compiling the app
# post_compile="pwd"

# Set the path the app is run from
# runtime_path=/app

Fix copy_hex() to suit registry v2

copy_hex() copies registry.ets to the build directory, but this file is no longer fetched after Hex 0.14.0 introduced registry v2.

On the other hand, I'm not sure if cache.ets is the right substitute as well.

As a sidenote, cache.ets isn't generated by running mix deps.get. Seems silly to run mix hex.info just so you can copy this file over.

build_backup folder growing out of control

Hi, we've been using this buildpack without issue in production for some time now. However recently we've been noticing some oddities. The largest one is that the _build/build_backup folder is growing out of control causing an error of: Compiled slug size: 505.2M is too large (max is 500M). Looking into the error it looks like the culprit is the build_backup folder:

~/_build $ ls /app/_build/build_backup/
build_backup  staging  test
~/_build $ ls /app/_build/build_backup/
build_backup  staging  test
~/_build $ ls /app/_build/build_backup/build_backup/
build_backup  staging  test
~/_build $ ls /app/_build/build_backup/build_backup/build_backup/
build_backup  staging  test
~/_build $ ls /app/_build/build_backup/build_backup/build_backup/build_backup/
build_backup  staging  test
~/_build $ du -hs /app/_build/build_backup/build_backup/build_backup/build_backup/
1.2G    /app/_build/build_backup/build_backup/build_backup/build_backup/
~/_build $ du -hs /app/_build/build_backup/build_backup/build_backup/build_backup/*
1.2G    /app/_build/build_backup/build_backup/build_backup/build_backup/build_backup
39M     /app/_build/build_backup/build_backup/build_backup/build_backup/staging
4.0K    /app/_build/build_backup/build_backup/build_backup/build_backup/test

As you can see the entire folder has grown to over 1.2GB! For some reason each build_backup is being saved within the existing build_backup. It seems to point to some type of problem with deleting the previous backups which appears to be on line 56 of app_funcs.sh

rm -rf $(deps_backup_path) $(build_backup_path)

Is there anything we can do to help debug this issue? Right now we're working around it by adding /app/_build/build_backup/build_backup to our .slugignore file. This brought the compressed size of the slug down from 505MB to 79MB.

Find alternative place for hosting OTP releases

Currently Hex is hosting them, but Hex has enough costs hosting it's own stuff. Additionally I spend enough on other administrative tasks related to Hex (it takes some of time to build the releases and making sure they are up to date). It's not sustainable long term for Hex to continuing the hosting. If anyone wants to take it over I will walk them through the process of building.

Ability to lock hex version

I'm getting this message when pushing my app now that Elixir 1.1 is out:

Hex was built against against Elixir v1.1.0-rc.0 and you are running v1.0.5, please run `mix local.hex` to update to a matching version

Which in turn causes the compilation to fail:

       == Compilation error on file lib/inventory_service/endpoint.ex ==
       ** (Protocol.UndefinedError) protocol Access not implemented for {:system, "DATABASE_URL"}
       (elixir) lib/access.ex:1: Access.impl_for!/1
       (elixir) lib/access.ex:33: Access.get/2
       lib/inventory_service/endpoint.ex:2: (module)
       (stdlib) erl_eval.erl:669: :erl_eval.do_apply/6

Phoenix support

grep for the string "{:phoenix," in mix.exs and do the following if Phoenix is detected

1.) use appropriate default process type (mix phoenix.server) in bin/release script if Phoenix is detected

We can expand to other frameworks later if required.

2.) compile assets before compiling app

Phoenix uses brunch. If we detect a brunch config, then we could run brunch build --production. But I would vote for requiring users to have an npm build task instead and running something like "npm run build --production". This way it's tooling independent.

3.) use mix phoenix.digest as post-compile hook (if post_compile hook is specifically mentioned in buildpack config, then that must be used instead)
4.) use a database addon in bin/release

This is assuming almost all Phoenix apps use a database.

\cc: @ericmj

PushState support

Does this buildpack support PushStates? I was able to successfully remove /#/ from my Phoenix and ReactJS app on localhost but it doesn't work on staging (Heroku).

Support option to skip reusing cached _build folder upon deployment

I ran into this issue after upgrading the dependencies in my app, which upgraded fine on my local machine, but not on the Dokku server.

remote: Dependencies have diverged:
remote: * postgrex (Hex package)
remote:   the dependency postgrex
remote:
remote:   > In mix.exs:
remote:     {:postgrex, ">= 0.0.0", [hex: :postgrex, manager: :mix]}
remote:
remote:   does not match the requirement specified
remote:
remote:   > In deps/ecto/mix.exs:
remote:     {:postgrex, "~> 0.11.0", [optional: true, hex: :postgrex]}
remote:
remote:   Ensure they match or specify one of the above in your deps and set "override: true"
remote: ** (Mix) Can't continue due to errors on dependencies

After some digging around, the problem lies with elixir-lang/elixir#4191 which the solution is to nuke the _build folder upon new deployment.

As the current buildpack does not support just skipping the reuse of _build folder, I had to rebuild the entire app, to ensure the _build folder isn't reused. With this, the problem went away.

It would be great if we have support for this, perhaps via ENV variable, since it doesn't seem to be a permanent option to be committed.

Brunch not found, but I'm using Gulp!

I'm getting the following error, although I have set things up to use Gulp. It all works on my computer, so I'm not sure what to do next

remote:        Running default compile
remote:        /app/tmp/buildpacks/abc8fb9e8be131ec2574c4ba9e31b81540d97b3bbce47d96e05959c4f81404ac71605dd35ebbcf7a1abe958c346d8ee266ff035de9254424eb54e8b9480059be/compile: line 1: brunch: command not found
remote:  !     Push rejected, failed to compile Phoenix app.
remote: 
remote:  !     Push failed

set MIX_ENV

I have tried to set the MIX_ENV to a custom value but it still using prod on heroku.

Add support for Erlang 17 (or if it already exists, document it?)

So I see where the buildpack downloads the OTP releases, but I couldn't find an URL where 17 was built (seems to download from your own S3 rather than an ErlangSolutions url or something like that). I can't browse the dir because S3, and no guessed URLs seemed to work :-\

Elixir 1.4.5 build fails

I believe the cause is that Elixir cannot be downloaded from https://s3.amazonaws.com/s3.hex.pm/builds/elixir/v1.4.5.zip (response is a 403 forbidden error with XML content). Who is responsible for uploading these packages?

remote: -----> Fetching Elixir v1.4.5
remote: -----> Installing Elixir v1.4.5 (changed)
remote: [/app/tmp/cache/elixir-v1.4.5.zip]
remote:   End-of-central-directory signature not found.  Either this file is not
remote:   a zipfile, or it constitutes one disk of a multi-part archive.  In the
remote:   latter case the central directory and zipfile comment will be found on
remote:   the last disk(s) of this archive.
remote: unzip:  cannot find zipfile directory in one of /app/tmp/cache/elixir-v1.4.5.zip or
remote:         /app/tmp/cache/elixir-v1.4.5.zip.zip, and cannot find /app/tmp/cache/elixir-v1.4.5.zip.ZIP, period.
remote: chmod: cannot access ‘/tmp/build_55d98dfe4a0f762b916a2fe1ccdad0fb/.platform_tools/elixir/bin/*’: No such file or directory
remote: -----> Installing Hex
remote: /app/tmp/buildpacks/7dbb5567c3a8b869f9516cd869ebf95082d7cf78f12fea9cba8fad1e1923c580f31b53ba792ed7279cc47894e95fe878ef82661603023bf1f6a023e7c7953587/lib/elixir_funcs.sh: line 87: mix: command not found
remote: -----> Installing rebar
remote: /app/tmp/buildpacks/7dbb5567c3a8b869f9516cd869ebf95082d7cf78f12fea9cba8fad1e1923c580f31b53ba792ed7279cc47894e95fe878ef82661603023bf1f6a023e7c7953587/lib/elixir_funcs.sh: line 93: mix: command not found
remote: -----> Fetching app dependencies with mix
remote: /app/tmp/buildpacks/7dbb5567c3a8b869f9516cd869ebf95082d7cf78f12fea9cba8fad1e1923c580f31b53ba792ed7279cc47894e95fe878ef82661603023bf1f6a023e7c7953587/lib/app_funcs.sh: line 47: mix: command not found
remote:  !     Push rejected, failed to compile Elixir app.
remote: 
remote:  !     Push failed
remote: Verifying deploy...
remote: 
remote: !	Push rejected to 

Error in the documentation

The buildpack url in the section below misses to end with '.git'.

Set the buildpack for an existing Heroku app

heroku buildpacks:set https://github.com/HashNuke/heroku-buildpack-elixir

This was causing heroku build to fail:

remote: -----> Failed to detect app matching https://github.com/HashNuke/heroku-buildpack-elixir buildpack
remote:        More info: https://devcenter.heroku.com/articles/buildpacks#detection-failure
remote: 
remote:  !     Push failed

mix: command not found

Hi,

I'm seeing this in the logs when I attempt to start my app on heroku:

/tmp/buildpack20151230-161-1kz7l10/compile: line 2: mix: command not found

and the app exits with that 'not found' error.

Hex 0.9.0 issue when updating Elixir to 1.1.0

Just tried updating a heroku app to 1.1.0 by updating the elixir_version in my elixir_buildpack.config.

When I push to heroku I get:

remote: -----> Using cached Elixir v1.1.0
remote: -----> Installing Elixir v1.1.0
remote: -----> Installing Hex
remote: * creating /app/.mix/archives/hex-0.9.0.ez
remote: -----> Installing rebar
remote: * creating /app/.mix/rebar
remote: -----> Fetching app dependencies with mix
remote: Running dependency resolution
remote: All dependencies up to date
remote: cp: cannot stat ‘/app/.mix/archives/hex.ez’: No such file or directory

The compilation proceeds and the slug is built and deployed but when I hit the application I get an error and the following in the heroku logs:

2015-09-26T15:00:48.868977+00:00 heroku[web.1]: Starting process with command `mix phoenix.server`
2015-09-26T15:00:51.827994+00:00 app[web.1]: Shall I install Hex? [Yn] ** (Mix) Could not find an SCM for dependency :phoenix from Phlink.Mixfile
2015-09-26T15:00:51.811929+00:00 app[web.1]: Could not find Hex, which is needed to build dependency :phoenix
2015-09-26T15:00:52.694003+00:00 heroku[web.1]: State changed from starting to crashed
2015-09-26T15:00:52.683127+00:00 heroku[web.1]: Process exited with status 1

Run mix compile.protocols on v0.14.0

Once Elixir v0.14.0 is out, the build pack could automatically compile and consolidate protocols. Calling mix compile.protocols will generate a consolidated path and we just need to guarantee the path will be added to the code path at boot time.

After this is done, someone should verify the protocols are consolidated by calling Protocol.consolidated?(Enumerable). For more info, please check this commit: elixir-lang/elixir@e24cef0

/cc @ericmj

Plug app having trouble binding to Heroku's port

similar to gjaldon/heroku-buildpack-phoenix-static#23

I can't seem to get my Plug app to bind to Heroku's Port.

My config_vars_to_export-

config_vars_to_export=(DATABASE_URL POOL_SIZE PORT MIX_ENV)

My supervisor -

defmodule Hook do
  use Application

  @port Application.get_env(:hook, :port)

  # See http://elixir-lang.org/docs/stable/elixir/Application.html
  # for more information on OTP Applications
  def start(_type, _args) do
    import Supervisor.Spec, warn: false

    # Define workers and child supervisors to be supervised
    children = [
      supervisor(Hook.Repo, []),
      # Starts a worker by calling: Hook.Worker.start_link(arg1, arg2, arg3)
      Plug.Adapters.Cowboy.child_spec(:http, Hook.Router, %{}, [port: @port])
    ]

    # See http://elixir-lang.org/docs/stable/elixir/Supervisor.html
    # for other strategies and supported options
    opts = [strategy: :one_for_one, name: Hook.Supervisor]
    Supervisor.start_link(children, opts)
  end
end

in config/config.ex -

config :hook, port: String.to_integer(System.get_env("PORT") || "4001")

Any ideas?

Config vars coming up as nil during compile

I'm trying to deploy my app to Heroku, but getting this error near the end:

** (Mix.Config.LoadError) could not load config config/prod.exs
remote:        ** (FunctionClauseError) no function clause matching in String.to_charlist/1
remote:        (elixir) lib/string.ex:1795: String.to_charlist(nil)
remote:        (stdlib) erl_eval.erl:670: :erl_eval.do_apply/6
remote:        (stdlib) erl_eval.erl:878: :erl_eval.expr_list/6
remote:        (stdlib) erl_eval.erl:236: :erl_eval.expr/5
remote:        (stdlib) erl_eval.erl:228: :erl_eval.expr/5
remote:        (stdlib) erl_eval.erl:229: :erl_eval.expr/5
remote:        (stdlib) erl_eval.erl:878: :erl_eval.expr_list/6
remote:        (stdlib) erl_eval.erl:236: :erl_eval.expr/5
remote:        
remote:  !     Push rejected, failed to compile Phoenix app.

This line is causing the error:

host: String.to_charlist(System.get_env("REDIS_URL"))

I have REDIS_URL defined in my config vars. In fact it says it is exporting them at the beginning of the deploy:

...
remote: -----> Checking Erlang and Elixir versions
remote:        Will use the following versions:
remote:        * Stack cedar-14
remote:        * Erlang 19.3
remote:        * Elixir 1.4.0 
remote: -----> Will export the following config vars:
remote: DATABASE_URL
remote: NODE_ID
remote: POOL_SIZE
remote: REDIS_PORT
remote: REDIS_URL
remote: SECRET_KEY_BASE
remote: SENDGRID_KEY
remote: STRIPE_LIVE_SECRET_KEY
remote:        * MIX_ENV=prod
...

So if the REDIS_URL is getting exported, how come it is returned as nil during compile?

Heroku CI requires to always rebuild

I'm currently testing the Heroku CI beta and noticed that randomly tests would fail due to new code not being complied properly.

I can work around this by setting always_rebuild=true, but I would prefer not to. Any idea what's going on?

rebar: Command not found

Today I was deploying an Elixir app to a Dokku instance using this buildpack and failed to compile "ssl_verify_hostname".

===> ssl_verify_hostname
    rebar get-deps-compile
    make: rebar: Command not found
    make: *** [erl] Error 127

Full log is here.

It compiles just fine locally, and so it used to do remotely until a few days ago.

I have tried forcing full recompilation by putting always_build_deps=true inside elixir_buildpack.config without any luck.

Any clue? Thanks in advance!

Unable to deploy both Elixir 1.4.0 and 1.4.1

1.4.0 gives the following error:

remote: -----> Elixir app detected
remote: -----> Checking Erlang and Elixir versions
remote:        Will use the following versions:
remote:        * Stack cedar-14
remote:        * Erlang 19
remote:        * Elixir 1.4.0 
remote:        Will export the following config vars:
remote:        * Config vars DATABASE_URL
remote:        * MIX_ENV=prod
remote: -----> Fetching Erlang 19
remote: -----> Installing Erlang 19 (changed)
remote: 
remote: gzip: stdin: not in gzip format
remote: tar: Child returned status 1
remote: tar: Error is not recoverable: exiting now
remote: /app/tmp/buildpacks/7dbb5567c3a8b869f9516cd869ebf95082d7cf78f12fea9cba8fad1e1923c580f31b53ba792ed7279cc47894e95fe878ef82661603023bf1f6a023e7c7953587/lib/erlang_funcs.sh: line 37: /app/tmp/cache/erlang/Install: No such file or directory
remote: -----> Fetching Elixir v1.4.0
remote: -----> Installing Elixir v1.4.0 (changed)
remote: -----> Installing Hex
remote: /tmp/build_63f3c75d31ba91ce34d617ac4538941d/.platform_tools/elixir/bin/elixir: 126: exec: erl: not found
remote: -----> Installing rebar
remote: /tmp/build_63f3c75d31ba91ce34d617ac4538941d/.platform_tools/elixir/bin/elixir: 126: exec: erl: not found
remote: -----> Fetching app dependencies with mix
remote: /tmp/build_63f3c75d31ba91ce34d617ac4538941d/.platform_tools/elixir/bin/elixir: 126: exec: erl: not found
remote:  !     Push rejected, failed to compile Elixir app.
remote: 
remote:  !     Push failed

1.4.1 gives this error:

remote: -----> Elixir app detected
remote: -----> Checking Erlang and Elixir versions
remote:        Will use the following versions:
remote:        * Stack cedar-14
remote:        * Erlang 19
remote:        * Elixir 1.4.1 
remote:        Will export the following config vars:
remote:        * Config vars DATABASE_URL
remote:        * MIX_ENV=prod
remote: -----> Fetching Erlang 19
remote: -----> Installing Erlang 19 (changed)
remote: 
remote: gzip: stdin: not in gzip format
remote: tar: Child returned status 1
remote: tar: Error is not recoverable: exiting now
remote: /app/tmp/buildpacks/7dbb5567c3a8b869f9516cd869ebf95082d7cf78f12fea9cba8fad1e1923c580f31b53ba792ed7279cc47894e95fe878ef82661603023bf1f6a023e7c7953587/lib/erlang_funcs.sh: line 37: /app/tmp/cache/erlang/Install: No such file or directory
remote: -----> Fetching Elixir v1.4.1
remote: -----> Installing Elixir v1.4.1 (changed)
remote: -----> Installing Hex
remote: /tmp/build_597df76bd9e5afe5431227a6ca33a5dc/.platform_tools/elixir/bin/elixir: 126: exec: erl: not found
remote: -----> Installing rebar
remote: /tmp/build_597df76bd9e5afe5431227a6ca33a5dc/.platform_tools/elixir/bin/elixir: 126: exec: erl: not found
remote: -----> Fetching app dependencies with mix
remote: /tmp/build_597df76bd9e5afe5431227a6ca33a5dc/.platform_tools/elixir/bin/elixir: 126: exec: erl: not found
remote:  !     Push rejected, failed to compile Elixir app.
remote: 
remote:  !     Push failed

Example with Umbrella app

I have written an umbrella app including a phoenix server. I can run it my using mix phoenix.server from apps/server but can't work out how to replicate that via the buildpack, procfile... on heroku itself

Don't require `always_rebuild=true` to pull in app changes

I'm seeing the following behavior in my Phoenix app on Heroku using this buildpack. I wonder if I'm doing something wrong...

My app deploys to Heroku fine the first time and runs without issue. However, subsequent deploys don't pick up any changes made since the previous deploy. If I edit a model, that new model source exists on Heroku after the build (when I browse the dyno filesystem via heroku run bash), but when running the app it's still using the previous build's compiled code (as evidence by the new functionality not being executed nor any stack trace line numbers matching the new source).

If I add always_rebuild=true to my elixir_buildpack.config, the app is recompiled and new changes are properly executed. However, as you know, that incurs a pretty stiff penalty as each deploy now requires the whole world to be recompiled.

Is this expected behavior?

My Procfile is (this behavior exists for both versions of the web process type):

# web: mix phoenix.server
web: yes | mix compile.protocols && elixir -pa _build/prod/consolidated -S mix phoenix.server

Here's my elixir_buildpack.config

erlang_version=17.5
elixir_version=1.0.4
always_rebuild=true

Failing to install Erlang 17.1

Not sure this is a bug or if I'm misaddressing the Erlang version, but using this elixir_buildpack.config the installation of Erlang fails.

erlang_version=17.1

elixir_version=0.14.3

always_build_deps=false

I got this error message:

% g push heroku master
Fetching repository, done.
Counting objects: 19, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (13/13), done.
Writing objects: 100% (13/13), 1.21 KiB | 0 bytes/s, done.
Total 13 (delta 8), reused 0 (delta 0)

-----> Fetching custom git buildpack... done
-----> elixir app detected
-----> Checking Erlang and Elixir versions
       Will use the following versions:
       * Erlang 17.1
       * Elixir 0.14.3
       Downloading Erlang package
-----> Fetching Erlang 17.1
-----> Installing Erlang 17.1

gzip: stdin: not in gzip format
tar: Child returned status 1
tar: Exiting with failure status due to previous errors
/tmp/buildpack_809d2e12-f3eb-495e-b37a-dcaea4e66f9d/lib/erlang_funcs.sh: line 61: /app/tmp/cache/erlang/Install: No such file or directory
-----> [skip] Already downloaded Elixir 0.14.3
-----> Unpacking Elixir 0.14.3
-----> Installing Elixir 0.14.3
-----> Installing Hex
exec: 93: erl: not found
-----> Installing rebar
exec: 93: erl: not found
-----> Fetching app dependencies with mix
exec: 93: erl: not found

 !     Push rejected, failed to compile elixir app

Not rebuilding dependencies?

Hi, so I'm using the ja_serializer gem which requires to be rebuilt after a setting is changed, via mix deps.clean ja_serializer && mix deps.get (https://github.com/AgilionApps/ja_serializer#attribute-relationship-and-query-param-key-format).

Now this does not seem to be working in heroku, So next I tried passing the always_rebuild=true flag to buildpack, but again this did not work (and from the heroku log at least, I can't see that dependencies are being rebuilt).

My fix for this has been to set dependency one version lower, then upgrade again, which will recompile it as expected.

SASS not compiling using this build pack.

Hi guys, I just deployed my barebones Phoenix app to Heroku and my single base.sass file is not compiling on Heroku.

Output is saying I need to gem install sass for compilation to work.

Where can I specify this on my buildpack?

"unary operator expected" error at Bluemix

Hi,

I just tried to deploy your buildpack to Bluemix and got this error messages:

Cloning into '/tmp/buildpacks/heroku-buildpack-elixir'...
-----> Checking Erlang and Elixir versions
       Will use the following versions:
       * Stack 
       * Erlang 17.4
       * Elixir 1.0.2 
       Will export the following config vars:
       * Config vars DATABASE_URL
       * MIX_ENV=prod
-----> Cleaning all cache to force rebuilds
/tmp/buildpacks/heroku-buildpack-elixir/lib/erlang_funcs.sh: line 7: [: =: unary operator expected
-----> Fetching Erlang 17.4
-----> Installing Erlang 17.4
-----> Fetching Elixir v1.0.2
-----> Installing Elixir v1.0.2
/tmp/buildpacks/heroku-buildpack-elixir/lib/elixir_funcs.sh: line 25: [: =: unary operator expected
/tmp/buildpacks/heroku-buildpack-elixir/lib/elixir_funcs.sh: line 28: jar: command not found
chmod: cannot access `/tmp/staged/app/.platform_tools/elixir/bin/*': No such file or directory
-----> Installing Hex
/tmp/buildpacks/heroku-buildpack-elixir/lib/elixir_funcs.sh: line 94: mix: command not found
-----> Installing rebar
/tmp/buildpacks/heroku-buildpack-elixir/lib/elixir_funcs.sh: line 109: mix: command not found
-----> Fetching app dependencies with mix

where could this unary operator expected come from?

Thanks in advance

Support Elixir 1.4

Buildpack can't unzip elixir-1.4.zip after fetch.

It's likely the pre-compiled build doesn't exist yet, and curl saved the error response as the zip.

remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Elixir app detected
remote: -----> Checking Erlang and Elixir versions
remote:        Will use the following versions:
remote:        * Stack cedar-14
remote:        * Erlang 19.2

remote:        * Elixir 1.4
remote:        Will export the following config vars:
remote:        * Config vars DATABASE_URL
remote:        * MIX_ENV=prod
remote: -----> Fetching Erlang 19.2
remote: -----> Installing Erlang 19.2 (changed)
remote:
remote: -----> Fetching Elixir 1.4
remote: -----> Installing Elixir 1.4 (changed)
remote: [/app/tmp/cache/elixir-1.4.zip]
remote:   End-of-central-directory signature not found.  Either this file is not
remote:   a zipfile, or it constitutes one disk of a multi-part archive.  In the
remote:   latter case the central directory and zipfile comment will be found on
remote:   the last disk(s) of this archive.
remote: unzip:  cannot find zipfile directory in one of /app/tmp/cache/elixir-1.4.zip or
remote:         /app/tmp/cache/elixir-1.4.zip.zip, and cannot find /app/tmp/cache/elixir-1.4.zip.ZIP, period.
remote: chmod: cannot access ‘/tmp/build_fcd55f279c925cc0caa12092f2fa9474/.platform_tools/elixir/bin/*’: No such file or directory
remote: -----> Installing Hex
remote: /app/tmp/buildpacks/7dbb5567c3a8b869f9516cd869ebf95082d7cf78f12fea9cba8fad1e1923c580f31b53ba792ed7279cc47894e95fe878ef82661603023bf1f6a023e7c7953587/lib/elix
ir_funcs.sh: line 87: mix: command not found
remote: -----> Installing rebar
remote: /app/tmp/buildpacks/7dbb5567c3a8b869f9516cd869ebf95082d7cf78f12fea9cba8fad1e1923c580f31b53ba792ed7279cc47894e95fe878ef82661603023bf1f6a023e7c7953587/lib/elix
ir_funcs.sh: line 93: mix: command not found
remote: -----> Fetching app dependencies with mix
remote: /app/tmp/buildpacks/7dbb5567c3a8b869f9516cd869ebf95082d7cf78f12fea9cba8fad1e1923c580f31b53ba792ed7279cc47894e95fe878ef82661603023bf1f6a023e7c7953587/lib/app_
funcs.sh: line 47: mix: command not found
remote:  !     Push rejected, failed to compile Elixir app.
remote:
remote:  !     Push failed

Try detect if application is not running in permanent mode

Elixir 1.0.4 will add CLI and mix.exs options to run application in permanent mode. Permanent mode ensures that the process will crash if the application crashes so Heroku will restart the process.

It is important to run in permanent mode on Heroku so we should try to detect if the app is not running with it and print a simple warning.

/cc @josevalim

Installing and caching node modules fails on deploy

Could this be caused by running --no-brunch when I created my phoenix app?

remote: -----> Building dependencies
remote:        Installing and caching node modules
remote: /app/tmp/buildpacks/abc8fb9e8be131ec2574c4ba9e31b81540d97b3bbce47d96e05959c4f81404ac71605dd35ebbcf7a1abe958c346d8ee266ff035de9254424eb54e8b9480059be/lib/build.sh: line 105: cd: /tmp/build_490c0270ec3e1d3a3c60bf5410e8c3d3/./assets: No such file or directory
remote:  !     Push rejected, failed to compile Phoenix app.

jar: command not found

I set the build pack on heroku and made a push for a phoenix app.
Procfile and build pack config were not created so that it could use the default.

I end up getting this error:

-----> Fetching custom git buildpack... done
-----> elixir app detected
-----> Checking Erlang and Elixir versions
       WARNING: elixir_buildpack.config wasn't found in the app
       Using default config from Elixir buildpack
       Will use the following versions:
       * Erlang 17.2
       * Elixir 1.0.0
       Will export the following config vars:
       * Config vars DATABASE_URL
       Downloading Erlang package
-----> Fetching Erlang 17.2
-----> Installing Erlang 17.2

-----> Downloading Elixir
-----> Installing Elixir v1.0.0
/tmp/buildpack_ab24114e6c0dd967aedd51c578c2c41d/lib/elixir_funcs.sh: line 24: jar: command not found
chmod: cannot access '/tmp/build_ab24114e6c0dd967aedd51c578c2c41d/.platform_tools/elixir/bin/*': No such file or directory
-----> Installing Hex
/tmp/buildpack_ab24114e6c0dd967aedd51c578c2c41d/lib/elixir_funcs.sh: line 89: mix: command not found
-----> Installing rebar
/tmp/buildpack_ab24114e6c0dd967aedd51c578c2c41d/lib/elixir_funcs.sh: line 104: mix: command not found
-----> Fetching app dependencies with mix
/tmp/buildpack_ab24114e6c0dd967aedd51c578c2c41d/lib/app_funcs.sh: line 37: mix: command not found

 !     Push rejected, failed to compile elixir app

Is this a known issue with a fix? Thanks.

Heroku build not working?

Hi

I received the following errors when using the buildpack to deploy onto heroku ?

2014-08-13T16:45:20+00:00 heroku[slug-compiler]: Slug compilation failed: failed to compile elixir app
exec: 28: /tmp/build_61b49664-1b9a-4689-87f1-410e315de4a4/.platform_tools/erlang/erts-6.0/bin/erlexec: not found

I'm not sure how to debug this as nothing has changed from a previous setup?

Hex installation is broken

Build output:

Copying hex from
remote: cp: missing destination file operand after ‘/tmp/build_7239412cab625558e211972bd15b7208/.mix/archives’
remote: Try 'cp --help' for more information.

The app crashes at startup with:

Shall I install Hex? [Yn] ** (Mix) Could not find an SCM for dependency :plug from HexWeb.Mixfile

/cc @HashNuke @chrismcg

Error on deployment

Hi

I am deploying on Dokku using this buildpack, but I receive the following error

Using cached Elixir v1.3.2
-----> Installing Elixir v1.3.2
-----> Installing Hex

       18:41:13.254 [error] Failed updating session:
       ProfileName: :httpc_mix
       SessionId:   {{'repo.hex.pm', 443}, #PID<0.113.0>}
       Pos:         7
       Value:       0
       when
       Session (db) info: :undefined
       Session (db):      {:session, {{'repo.hex.pm', 443}, #PID<0.113.0>}, false, :https,
       {:sslsocket, {:gen_tcp, #Port<0.4608>, :tls_connection, :undefined},
       #PID<0.114.0>}, {:essl, []}, 1, :keep_alive, true}
       Session (record):  {:EXIT,
       {:badarg,
       [{:ets, :lookup,
       [:httpc_mix__session_db, {{'repo.hex.pm', 443}, #PID<0.113.0>}], []},
       {:httpc_manager, :lookup_session, 2, [file: 'httpc_manager.erl', line: 189]},
       {:httpc_handler, :update_session, 4,
       [file: 'httpc_handler.erl', line: 1909]},
       {:httpc_handler, :handle_empty_queue, 4,
       [file: 'httpc_handler.erl', line: 1368]},
       {:httpc_handler, :handle_info, 2, [file: 'httpc_handler.erl', line: 471]},
       {:gen_server, :try_dispatch, 4, [file: 'gen_server.erl', line: 601]},
       {:gen_server, :handle_msg, 5, [file: 'gen_server.erl', line: 667]},
       {:proc_lib, :init_p_do_apply, 3, [file: 'proc_lib.erl', line: 247]}]}}
       T: :error
       E: :badarg

       18:41:13.259 [error] Failed updating session:
       ProfileName: :httpc_mix
       SessionId:   {{'repo.hex.pm', 443}, #PID<0.113.0>}
       Pos:         9
       Value:       true
       when
       Session (db) info: :undefined
       Session (db):      {:session, {{'repo.hex.pm', 443}, #PID<0.113.0>}, false, :https,
       {:sslsocket, {:gen_tcp, #Port<0.4608>, :tls_connection, :undefined},
       #PID<0.114.0>}, {:essl, []}, 1, :keep_alive, false}
       Session (record):  {:EXIT,
       {:badarg,
       [{:ets, :lookup,
       [:httpc_mix__session_db, {{'repo.hex.pm', 443}, #PID<0.113.0>}], []},
       {:httpc_manager, :lookup_session, 2, [file: 'httpc_manager.erl', line: 189]},
       {:httpc_handler, :update_session, 4,
       [file: 'httpc_handler.erl', line: 1909]},
       {:httpc_handler, :maybe_make_session_available, 2,
       [file: 'httpc_handler.erl', line: 1516]},
       {:httpc_handler, :answer_request, 3,
       [file: 'httpc_handler.erl', line: 1507]},
       {:httpc_handler, :terminate, 2, [file: 'httpc_handler.erl', line: 759]},
       {:gen_server, :try_terminate, 3, [file: 'gen_server.erl', line: 629]},
       {:gen_server, :terminate, 7, [file: 'gen_server.erl', line: 795]}]}}
       T: :error
       E: :badarg

       18:41:13.286 [error] GenServer #PID<0.113.0> terminating
       ** (stop) {:failed_updating_session, [profile: :httpc_mix, session_id: {{'repo.hex.pm', 443}, #PID<0.113.0>}, pos: 9, value: true, etype: :error, error: :badarg, stacktrace: [{:ets, :update_element, [:httpc_mix__session_db, {{'repo.hex.pm', 443}, #PID<0.113.0>}, {9, true}], []}, {:httpc_manager, :update_session, 4, [file: 'httpc_manager.erl', line: 210]}, {:httpc_handler, :update_session, 4, [file: 'httpc_handler.erl', line: 1887]}, {:httpc_handler, :maybe_make_session_available, 2, [file: 'httpc_handler.erl', line: 1516]}, {:httpc_handler, :answer_request, 3, [file: 'httpc_handler.erl', line: 1507]}, {:httpc_handler, :terminate, 2, [file: 'httpc_handler.erl', line: 759]}, {:gen_server, :try_terminate, 3, [file: 'gen_server.erl', line: 629]}, {:gen_server, :terminate, 7, [file: 'gen_server.erl', line: 795]}]]}
       (inets) httpc_handler.erl:1911: :httpc_handler.update_session/4
       (inets) httpc_handler.erl:1516: :httpc_handler.maybe_make_session_available/2
       (inets) httpc_handler.erl:1507: :httpc_handler.answer_request/3
       (inets) httpc_handler.erl:759: :httpc_handler.terminate/2
       (stdlib) gen_server.erl:629: :gen_server.try_terminate/3
       (stdlib) gen_server.erl:795: :gen_server.terminate/7
       (stdlib) proc_lib.erl:247: :proc_lib.init_p_do_apply/3
       Last message: {:ssl, {:sslsocket, {:gen_tcp, #Port<0.4608>, :tls_connection, :undefined}, #PID<0.114.0>}, <<233, 251, 153, 0, 82, 93, 50, 60, 58, 0, 128, 5, 239, 47, 63, 133, 71, 133, 103, 240, 196, 73, 237, 239, 91, 119, 46, 250, 122, 120, 246, 182, 250, 120, 150, 22, 102, 206, 207, 177, 139, 223, 233, 74, 246, 227, 27, 63, ...>>}
       State: {:state, {:request, #Reference<0.0.1.196>, #PID<0.71.0>, 0, :https, {'repo.hex.pm', 443}, '/installs/1.3.0/hex-0.13.0.ez', [], :get, {:http_request_h, :undefined, 'keep-alive', :undefined, :undefined, :undefined, :undefined, :undefined, :undefined, :undefined, :undefined, :undefined, :undefined, :undefined, :undefined, :undefined, :undefined, 'repo.hex.pm', :undefined, :undefined, :undefined, :undefined, :undefined, :undefined, :undefined, :undefined, :undefined, [], 'Mix/1.3.2', :undefined, :undefined, :undefined, '0', :undefined, :undefined, :undefined, :undefined, :undefined, ...}, {[], []}, {:http_options, 'HTTP/1.1', :infinity, true, {:essl, []}, :undefined, true, :infinity, false}, 'https://repo.hex.pm/installs/1.3.0/hex-0.13.0.ez', [], :none, [], 1470076873124, :undefined, :undefined, false}, {:session, {{'repo.hex.pm', 443}, #PID<0.113.0>}, false, :https, {:sslsocket, {:gen_tcp, #Port<0.4608>, :tls_connection, :undefined}, #PID<0.114.0>}, {:essl, []}, 1, :keep_alive, false}, {'HTTP/1.1', 200, 'OK'}, {:http_response_h, 'public, max-age=604800', 'keep-alive', 'Mon, 01 Aug 2016 18:41:13 GMT', :undefined, :undefined, :undefined, :undefined, '1.1 varnish', :undefined, 'bytes', '156864', '"001b2fb3d69b3d93616ac0241b5610aa"', :undefined, :undefined, :undefined, 'AmazonS3', :undefined, :undefined, :undefined, :undefined, :undefined, '372935', :undefined, :undefined, :undefined, 'application/andrew-inset', :undefined, 'Sat, 30 Jul 2016 23:05:49 GMT', [{'x-amz-id-2', '35bqzJpDJSMCfFdtmtw93YpKVHwWjgAASzWdolYr0E1vUvmmgJAZNy2SSdeg3zJVo0B0S0Z7/6I='}, {'x-amz-request-id', '92BBEB674531C133'}, {'x-amz-replication-status', 'PENDING'}, {'x-amz-meta-surrogate-key', 'installs'}, {'x-amz-version-id', 'Ua76o_1PQ.oYxmlDyoqJCh_SeGbu.P6p'}, {'x-served-by', 'cache-iad2628-IAD'}, {'x-cache', 'HIT'}, {'x-cache-hits', '1'}, {'x-timer', 'S1470076873.189701,VS0,VE1'}]}, :undefined, {:httpc_response, :whole_body, [<<80, 75, 3, 4, 20, 0, 0, 0, 0, 0, 171, 8, 255, 72, 200, 108, 91, 120, 153, 9, 0, 0, 153, 9, 0, 0, 23, 0, 0, 0, 104, 101, 120, 45, 48, 46, 49, 51, 46, 48, ...>>, 372935]}, {[], []}, {[], []}, :new, [], :nolimit, :nolimit, {:options, {:undefined, []}, {:undefined, []}, 0, 2, 5, 120000, 2, :disabled, false, :inet, :default, :default, []}, {:timers, [], :undefined}, :httpc_mix, :inactive}

Phoenix heroku bash: mix: command not found

I try to create elixir/phoenix project on heroku with this manual: http://www.phoenixframework.org/docs/heroku

wulp@wulp-vb:~/Documents/chatmeapp$ heroku create chatmeapp --buildpack "https://github.com/HashNuke/heroku-buildpack-elixir.git"
Creating ⬢ chatmeapp... done
Setting buildpack to https://github.com/HashNuke/heroku-buildpack-elixir.git... done
https://chatmeapp.herokuapp.com/ | https://git.heroku.com/chatmeapp.git

wulp@wulp-vb:~/Documents/chatmeapp$ heroku git:remote -a chatmeapp
set git remote heroku to https://git.heroku.com/chatmeapp.git

wulp@wulp-vb:~/Documents/chatmeapp$ heroku buildpacks:add https://github.com/gjaldon/heroku-buildpack-phoenix-static.git
Buildpack added. Next release on chatmeapp will use:
  1. https://github.com/HashNuke/heroku-buildpack-elixir.git
  2. https://github.com/gjaldon/heroku-buildpack-phoenix-static.git
Run git push heroku master to create a new release using these buildpacks.

wulp@wulp-vb:~/Documents/chatmeapp$ heroku addons:create heroku-postgresql:hobby-dev
Creating heroku-postgresql:hobby-dev on ⬢ chatmeapp... free
Database has been created and is available
 ! This database is empty. If upgrading, you can transfer
 ! data from another database with pg:copy
Created postgresql-tetrahedral-49526 as DATABASE_URL
Use heroku addons:docs heroku-postgresql to view documentation

wulp@wulp-vb:~/Documents/chatmeapp$ heroku config:set POOL_SIZE=18
Setting POOL_SIZE and restarting ⬢ chatmeapp... done, v4
POOL_SIZE: 18

wulp@wulp-vb:~/Documents/chatmeapp$ heroku run "POOL_SIZE=2 mix chatmeapp.task"
Running POOL_SIZE=2 mix chatmeapp.task on ⬢ chatmeapp... up, run.1524 (Free)
bash: mix: command not found

But I have error: bash: mix: command not found

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.