Skip to content

Instantly share code, notes, and snippets.

@hawkup
Last active October 15, 2016 18:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hawkup/0753b092bb1c257de0e4375bde8a488f to your computer and use it in GitHub Desktop.
Save hawkup/0753b092bb1c257de0e4375bde8a488f to your computer and use it in GitHub Desktop.
Start Elixir and Phoenix

Installing

  • Add Erlang Solution
wget https://packages.erlang-solutions.com/erlang-solutions_1.0_all.deb && sudo dpkg -i erlang-solutions_1.0_all.deb
sudo apt-get update
  • Install the Erlang/OTP platform and all of its applications
sudo apt-get install esl-erlang
  • Install Elixir
sudo apt-get install elixir

Running Interactive Elixir

$ iex

Installing Phoenix

mix archive.install https://github.com/phoenixframework/archives/raw/master/phoenix_new.ez

Installing node

Node is an optional dependency. Phoenix will use brunch.io to compile static assets. If we don't have any static assets, or we want to use another build tool, we can pass the --no-brunch flag when creating a new application and node won't be required at all.

Installing PostgreSQL

sudo apt-get update
sudo apt-get install postgresql postgresql-contrib

sudo -u postgres psql
# for exit \q

createdb {dbname}
OR
sudo -u postgres createdb {dbname}

OR can change to use Mysql by passing the --database mysql

Installing Inotify-tools (for linux users)

Phoenix use for live code reloading

sudo apt-get update
sudo apt-get install inotify-tools

Create a new project

mix phoenix.new {project_name}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment