Skip to content

Commit

Permalink
add dependencies section to overview and ask users to read it in up a…
Browse files Browse the repository at this point in the history
…nd running
  • Loading branch information
lancehalvorsen committed May 4, 2015
1 parent a92d581 commit db2b61a
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 4 deletions.
28 changes: 28 additions & 0 deletions 0_overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,31 @@ Cowboy is an HTTP server written in Erlang by Loïc Hoguin of [99s](http://ninen
Cowboy has fantastic documentation. The [Guides](http://ninenines.eu/docs/en/cowboy/HEAD/guide/) are especially helpful. Learning more about Cowboy will surely help you to understand Phoenix more fully.

Cowboy has its own section of links in the [Resources Guide](http://www.phoenixframework.org/docs/resources).


### System Dependencies

There are a number of dependencies external to Phoenix which we will encounter as we work our way through these guides. Elixir and Erlang are hard dependencies, meaning that we won't be able to work with Phoenix at all unless we have them installed. The rest may not prevent us from getting started if we don't have them, but their absence may lead to errors that prevent us from moving forward. Simply installing these dependencies may save us from confusion and frustration later on.

Let's take a look at each of them now.

- Elixir
Phoenix is written in Elixir, and our application code will also be written in Elixir. In order to do any work with Phoenix, we need Elixir installed on our system. The Elixir site itself has great [installation instructions](http://elixir-lang.org/install.html).

- Erlang
Elixir source code compiles to Erlang byte code which runs on the Erlang Virtual Machine. That means we must have Erlang installed on our system - in addition to Elixir - in order to work with Phoenix. The Elixir site also has [Erlang installation instructions](http://elixir-lang.org/install.html#installing-erlang).

- node.js
Node is an optional dependency. Phoenix will use brunch.io to compile static assets (javascript, css, etc), by default. Brunch.io uses the node package manager (npm) to install its dependencies, and npm requires node.js.

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.

- PostgreSQL
PostgreSQL is a relational database server. Phoenix configures applications to use it by default, but we can switch to MySQL by passing the `--database mysql` flag when creating a new application.

When we work with Ecto models in these guides, we will use PostgreSQL and the Postgrex adapter for it. In order to follow along with the examples, we will need to install PostgreSQL on our system. The PostgreSQL wiki has [installation guides](https://wiki.postgresql.org/wiki/Detailed_installation_guides) for a number of different systems.

- inotify-tools
This is a Linux-only filesystem watcher that Phoenix uses for live code reloading. (Mac OS X or Windows users can safely ignore it.)

Linux users need to install this dependency. Please consult the [inotify-tools wiki](https://github.com/rvoicilas/inotify-tools/wiki) for distribution-specific installation instructions.
10 changes: 6 additions & 4 deletions A_up_and_running.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
The aim of this first guide is to get a Phoenix application up and running as quickly as possible.

Before we begin, we will need to install Elixir and Erlang. The Elixir site itself has the latest and most complete [installation information](http://elixir-lang.org/install.html). Currently, Phoenix requires Elixir version 1.0.4 or greater which in turn requires Erlang version 17.5 or greater.
Before we begin, let's take a minute to review the "Dependencies" section of the [Overview Guide](http://www.phoenixframework.org/docs/overview). By installing any necessary external dependencies beforehand, we'll be able to get our application installed and running smoothly.

We will need to install Elixir and Erlang. The Elixir site itself has the latest and most complete [installation information](http://elixir-lang.org/install.html). Currently, Phoenix requires Elixir version 1.0.4 or greater which in turn requires Erlang version 17.5 or greater.

Let's get started.

First, if you have just installed Elixir, let's install the Hex package manager:
First, if we have just installed Elixir, let's install the Hex package manager:

```console
$ mix local.hex
Expand All @@ -16,9 +18,9 @@ Now we are ready to fetch the Phoenix installer:
$ mix archive.install https://github.com/phoenixframework/phoenix/releases/download/v0.12.0/phoenix_new-0.12.0.ez
```

> Note: if the Phoenix archive can't install, you can download the file directly from your browser, save it to your filesystem, and then run: `mix archive.install /path/to/local/phoenix_new.ez`.
> Note: if the Phoenix archive can't install, we can download the file directly from our browser, save it to the filesystem, and then run: `mix archive.install /path/to/local/phoenix_new.ez`.
Now `mix phoenix.new` can be run from any directory to bootstrap our Phoenix application. Phoenix will accept either an absolute or relative path for the directory of our new project. Assuming that the name of our application is `hello_phoenix`, either of these will work.
Now we can run `mix phoenix.new` from any directory in order to bootstrap our Phoenix application. Phoenix will accept either an absolute or relative path for the directory of our new project. Assuming that the name of our application is `hello_phoenix`, either of these will work.

```console
$ mix phoenix.new /Users/me/work/elixir-stuff/hello_phoenix
Expand Down

0 comments on commit db2b61a

Please sign in to comment.