Before you proceed with installing the dependencies for Elixir and Phoenix you will need to make sure you are running a compatible version of OSX. Click on the Apple icon in the top left of your screen and select “About This Mac” to check. In the window that comes up, under the title “OS X” there will be a version number. If you are running 10.9 or above you are all set to proceed to the next step if not you will need to upgrade.
Open Iterm or your terminal application of choice. Enter the following command to check if you already have xcode installed
If you see a similar output to below then you already have xcode installed and you can move on to step two.
Catherines-MacBook-Pro:~ BitGirl$ gcc --version Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include/c++/4.2.1 Apple LLVM version 8.1.0 (clang-802.0.42) Target: x86_64-apple-darwin16.6.0 Thread model: posix InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
To install xcode run the following command
When the download is complete you will see the program open up and ask if you want to install xcode. Click install
To check if you have Homebrew installed run
If that command returned a version number then you already have Homebrew installed. If you want to update to the latest version run the following command:
If that command returned an error then you will need to install Homebrew by running:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
You may be prompted for your user's password
Postgres is the type of database that we will be using for our application. To install run the following:
brew install postgres initdb /usr/local/var/postgres -E utf8
Now you will need to create a user for your Database
brew services start postgresql createuser -s postgres
brew install erlang elixir
brew install node
Since we have just installed Elixir for the first time, we will need to install the Hex package manager as well. Hex is necessary to get a Phoenix app running (by installing dependencies) and to install any extra dependencies we might need along the way.
Now that we have Hex installed we can install Phoenix
mix archive.install https://github.com/phoenixframework/archives/raw/master/phoenix_new.ez
If you haven't coded before you will want to take a look at additional tools for some extra tools that will help you get started otherwise we're good to go! Let's go write some elixir!