{"_id":"5484f8240d7c73140052fde5","githubsync":"","user":"5435b410495d5d0800f3a603","project":"54348ec95b10711400c6c445","version":{"_id":"5484f8220d7c73140052fdd7","__v":1,"forked_from":"547f8f293031bc0800e5fe7e","project":"54348ec95b10711400c6c445","createdAt":"2014-12-08T01:00:18.327Z","releaseDate":"2014-12-08T01:00:18.327Z","categories":["5484f8230d7c73140052fdd8","5484f8230d7c73140052fdd9","5484f8230d7c73140052fdda"],"is_deprecated":false,"is_hidden":false,"is_beta":true,"is_stable":false,"codename":"","version_clean":"0.6.2","version":"0.6.2"},"__v":5,"category":{"_id":"5484f8230d7c73140052fdd9","pages":["5484f8240d7c73140052fde4","5484f8240d7c73140052fde5","5484f8240d7c73140052fde6","5484f8240d7c73140052fde7","5484f8240d7c73140052fde8","5484f8240d7c73140052fde9","5484f8240d7c73140052fdea","5484f8240d7c73140052fdeb","5484f8240d7c73140052fdec","5484f8240d7c73140052fded"],"project":"54348ec95b10711400c6c445","__v":1,"version":"5484f8220d7c73140052fdd7","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2014-10-09T04:18:04.869Z","from_sync":false,"order":1,"slug":"guides","title":"Guides"},"updates":["5497dc5eccb8e70b0008c292","55717826a408bf0d00a4a3fa"],"next":{"pages":[],"description":""},"createdAt":"2014-10-09T18:43:00.381Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"basic_auth":false,"results":{"codes":[]},"try":true,"auth":"never","params":[],"url":""},"isReference":false,"order":1,"body":"The aim of this first guide is to get a Phoenix application up and running as quickly as possible.\n\nBefore 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/getting_started/1.html). Currently, Phoenix requires Elixir version 1.0.0 or greater which in turn requires Erlang version 17.0 or greater.\n\nIn order to install Phoenix, we will also need to have git installed on our system. While git is extremely popular, for those of us who may not have it installed, this is an important step. Github has some good documentation on [getting set up with git](https://help.github.com/articles/set-up-git).\n\nLet's get started.\n\nThe first thing we need to do is clone the phoenix repo from github. Let's navigate into a directory that we want to contain Phoenix. Cloning the repo will create a new directory called `phoenix` wherever we run the clone command. Here are the steps.\n\n- First, clone the repo\n```console\n$ git clone https://github.com/phoenixframework/phoenix.git\n```\n\n- Then cd into the phoenix directory itself\n```console\n$ cd phoenix\n```\n\n- And make sure we are on the v0.7.2 branch.\n```console\n$ git checkout v0.7.2\n```\n\n- Get the dependencies and compile the whole project\n```console\n$ mix do deps.get, compile\n```\nNote: This is passing a list of arguments to mix and is functionally equivalent to the two line version.\n\n```console\n$ mix deps.get\n```\n\n```console\n$ mix compile\n```\n\nOnce this is done, we need to have Phoenix generate a new project for us, and we need it to do so outside the Phoenix repo itself. Phoenix provides a mix task `phoenix.new` for this, and the task takes both the name of our new project and the path to where we want  the new application to live.\n\nPhoenix will accept either an absolute or relative path for the directory of our new project. Either of these will work.\n\n```console\n$ mix phoenix.new hello_phoenix /Users/me/work/elixir-stuff/hello_phoenix\n```\n\n```console\n$ mix phoenix.new hello_phoenix ../hello_phoenix\n```\n\nFor our purposes, a relative path will do.\n\n```console\n$ mix phoenix.new hello_phoenix ../hello_phoenix\n```\n\nWe can then `cd` into the new project directory.\n\n```console\n$ cd ../hello_phoenix\n```\n\nThe next step is to get and compile the dependencies that our phoenix application will need.\n\n```console\n$ mix do deps.get, compile\n```\nThis is different from the similar step we did above. That step was compiling Phoenix itself. This is compiling our new application, which Phoenix just generated.\n\nOnce the application compiles successfully, we can start it.\n\n```console\n$ mix phoenix.server\n```\n\nBy default Phoenix accepts requests on port 4000. If we point our favorite web browser at [http://localhost:4000](http://localhost:4000), we should see the Phoenix Framework welcome page.\n\n![Phoenix Welcome Page](/images/welcome-to-phoenix.png)\n\nIf your screen looks like the image above, congratulations! You now have working Phoenix application.\n\nLocally, our application is running in an iex session. To stop it, we hit ctrl-c twice, just as we would to stop iex normally.\n\nThe next step is customizing our application just a bit to give us a sense of how a Phoenix app is put together.\n[block:image]\n{\n  \"images\": [\n    {\n      \"caption\": \"Phoenix Welcome Page\",\n      \"image\": [\n        \"https://files.readme.io/dgQq2PC8SiyitRnHtf7A_welcome-to-phoenix.png\",\n        \"welcome-to-phoenix.png\",\n        \"1702\",\n        \"1262\",\n        \"\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\nIf your screen looks like the image above, congratulations! You now have working Phoenix application.\n\nLocally, our application is running in an iex session. To stop it, we hit ctrl-c twice, just as we would to stop iex normally.\n\nThe next step is customizing our application just a bit to give us a sense of how a Phoenix app is put together.","excerpt":"","slug":"up-and-running","type":"basic","title":"Up And Running"}
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/getting_started/1.html). Currently, Phoenix requires Elixir version 1.0.0 or greater which in turn requires Erlang version 17.0 or greater. In order to install Phoenix, we will also need to have git installed on our system. While git is extremely popular, for those of us who may not have it installed, this is an important step. Github has some good documentation on [getting set up with git](https://help.github.com/articles/set-up-git). Let's get started. The first thing we need to do is clone the phoenix repo from github. Let's navigate into a directory that we want to contain Phoenix. Cloning the repo will create a new directory called `phoenix` wherever we run the clone command. Here are the steps. - First, clone the repo ```console $ git clone https://github.com/phoenixframework/phoenix.git ``` - Then cd into the phoenix directory itself ```console $ cd phoenix ``` - And make sure we are on the v0.7.2 branch. ```console $ git checkout v0.7.2 ``` - Get the dependencies and compile the whole project ```console $ mix do deps.get, compile ``` Note: This is passing a list of arguments to mix and is functionally equivalent to the two line version. ```console $ mix deps.get ``` ```console $ mix compile ``` Once this is done, we need to have Phoenix generate a new project for us, and we need it to do so outside the Phoenix repo itself. Phoenix provides a mix task `phoenix.new` for this, and the task takes both the name of our new project and the path to where we want the new application to live. Phoenix will accept either an absolute or relative path for the directory of our new project. Either of these will work. ```console $ mix phoenix.new hello_phoenix /Users/me/work/elixir-stuff/hello_phoenix ``` ```console $ mix phoenix.new hello_phoenix ../hello_phoenix ``` For our purposes, a relative path will do. ```console $ mix phoenix.new hello_phoenix ../hello_phoenix ``` We can then `cd` into the new project directory. ```console $ cd ../hello_phoenix ``` The next step is to get and compile the dependencies that our phoenix application will need. ```console $ mix do deps.get, compile ``` This is different from the similar step we did above. That step was compiling Phoenix itself. This is compiling our new application, which Phoenix just generated. Once the application compiles successfully, we can start it. ```console $ mix phoenix.server ``` By default Phoenix accepts requests on port 4000. If we point our favorite web browser at [http://localhost:4000](http://localhost:4000), we should see the Phoenix Framework welcome page. ![Phoenix Welcome Page](/images/welcome-to-phoenix.png) If your screen looks like the image above, congratulations! You now have working Phoenix application. Locally, our application is running in an iex session. To stop it, we hit ctrl-c twice, just as we would to stop iex normally. The next step is customizing our application just a bit to give us a sense of how a Phoenix app is put together. [block:image] { "images": [ { "caption": "Phoenix Welcome Page", "image": [ "https://files.readme.io/dgQq2PC8SiyitRnHtf7A_welcome-to-phoenix.png", "welcome-to-phoenix.png", "1702", "1262", "", "" ] } ] } [/block] If your screen looks like the image above, congratulations! You now have working Phoenix application. Locally, our application is running in an iex session. To stop it, we hit ctrl-c twice, just as we would to stop iex normally. The next step is customizing our application just a bit to give us a sense of how a Phoenix app is put together.