Phoenix 1.5 requires Elixir >= 1.7. Be sure your existing version is up to date by running elixir -v on the command line.
$ mix archive.uninstall phx_new
$ mix archive.install hex phx_new 1.5.0| defmodule Randomizer do | |
| @moduledoc """ | |
| Random string generator module. | |
| """ | |
| @doc """ | |
| Generate random string based on the given legth. It is also possible to generate certain type of randomise string using the options below: | |
| * :all - generate alphanumeric random string | |
| * :alpha - generate nom-numeric random string |
| $ brew update && brew doctor # Repeat, until you've done *all* the Dr. has ordered! | |
| $ brew install postgresql # You'll need postgres to do this... you may also need to 'initdb' as well. Google it. | |
| $ brew install elixir | |
| $ mix local.hex # Answer y to any Qs | |
| $ createuser -d postgres # create the default 'postgres' user that Chris McCord seems to like -- I don't create mine w/a pw... | |
| # Use the latest Phoenix from here: http://www.phoenixframework.org/docs/installation -- currently this is 1.0.3 | |
| # ** Answer y to any Qs ** | |
| $ mix archive.install https://github.com/phoenixframework/phoenix/releases/download/v1.0.3/phoenix_new-1.0.3.ez |
| defmodule Fib do | |
| def fib(0) do 0 end | |
| def fib(1) do 1 end | |
| def fib(n) do fib(n-1) + fib(n-2) end | |
| end | |
| IO.puts Fib.fib(10) |