X-Git-Url: https://pwan.org/git/?p=pwan.org.git;a=blobdiff_plain;f=content%2Fhints%2Felixir-on-centos7.rst;fp=content%2Fhints%2Felixir-on-centos7.rst;h=55296224bb47ecaa3b5136cd95826fdaf7a12664;hp=0000000000000000000000000000000000000000;hb=6b4cb8e61e634b989a887c60fdd26d7140a8224f;hpb=78cc7b9eb414b40bc21c491f6809929573fffc7b diff --git a/content/hints/elixir-on-centos7.rst b/content/hints/elixir-on-centos7.rst new file mode 100644 index 0000000..5529622 --- /dev/null +++ b/content/hints/elixir-on-centos7.rst @@ -0,0 +1,53 @@ +Elixir on Centos 7 +################## + +:date: 2017-10-08 +:tags: hints, elixir, centos +:category: hints +:author: Jude N + +I'm at the point with a Elixir/Phoneix side project that I'm thinking about deployment. + +The first big stumbling block was that development envioronment (Ubuntu 16.04) wasn't the same as my deployment environment (Centos 7). +For Ubuntu, I could pull the latest Elixir packages from `Erlang Solutions`_, but they don't host Centos Elixir packages, +and the version of Elixir on EPEL is `over 4 years old`_ - old enough that 'mix deps' on my project was erroring out. + +I found the posts below about installing Elixir on Centos 7 but, they involve cloning the Elixir repo and building it from source, +but I don't want development tools like git and gcc on my production machines. + +- https://gist.github.com/binarytemple-clients/52bec05fc9bdba80d737 +- http://www.jeramysingleton.com/install-erlang-and-elixir-on-centos-7-minimal/ +- https://www.unixmen.com/install-erlang-elixir-centos-7/ + +I also found https://www.vultr.com/docs/how-to-install-the-phoenix-framework-on-centos-7 but it involves downloading a +precompiled `mystery meat`_ bundle off Github. However https://github.com/elixir-lang/elixir doesn't mention that these precompiled +bundles are available or how the bundles were built. The precompiled bundle is mentioned on `the elixir-lang.org install page`_, but still, that's too mysterious for me. + +Maybe one of those links will work for you, but `what I want`_ is a way to build a more recent version of the Elixir rpm than what was available in EPEL. That way I can recompile and package Elixir on a dev machine, and then only copy the rpm up to my production machine. + +It looks like Elixir is stuck in EPEL waiting for the Erlang 18 release to get promoted in EPEL, so maybe I can take the existing Elixir packaging source and build it against the latest Erlang packages from Erlang Solutions... + +I found the packaging source at https://src.fedoraproject.org/rpms/elixir and after poking around a bit I came up with Vagrantfile below. It seems to be working OK so far. +: + +.. raw:: html + + + +Lessons Learned +--------------- +- `spectool`_ is my new favorite utility. +- Make sure your Elixir development environment is as close as possible to your deployment environment. + +Next Steps +---------- +- Convert the Vagrantfile into a Dockerfile or start using vagrant-lxc + +.. _Erlang Solutions: https://www.erlang-solutions.com/resources/download.html +.. _over 4 years old: https://koji.fedoraproject.org/koji/buildinfo?buildID=552725 +.. _the elixir-lang.org install page: https://elixir-lang.org/install.html#precompiled-package +.. _mystery meat: http://www.torontosun.com/2017/07/19/mystery-meat-crashes-onto-florida-familys-roof +.. _spectool: http://pkgbuild.sourceforge.net/spectool.html +.. _what I want: https://www.youtube.com/watch?v=gJLIiF15wjQ + +