Skip to content

Commit

Permalink
Updated linux installation guide
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinMulhern committed Dec 5, 2016
1 parent 3f8cc64 commit 29f4f60
Showing 1 changed file with 78 additions and 17 deletions.
95 changes: 78 additions & 17 deletions doc/linux_setup.md
@@ -1,17 +1,4 @@
## Set up Ruby
In case you don't have the version of Ruby that the TheOdinProject uses, install it with rvm:
```
$ rvm install ruby-2.3
$ rvm use ruby-2.3
```

#### Bundler
If you needed to install the Ruby version specified previously, then you're going to need to install bundler all over again. Run the following commands for that:
```
$ sudo apt-get install bundler
$ gem install bundler
$ gem install bundle
```
**This guide assumes that you have already installed Ruby and rails. To get instructions on how to do that go through the installations project [here](http://www.theodinproject.com/web-development-101/installations)**

## Set up Postgres
Skip this is you have already installed and setup a user for postgresql.
Expand Down Expand Up @@ -57,9 +44,83 @@ Set up the test database:
$ rake db:test:prepare
```

Finally, get the server up and running with
## Get a Github API Token
You will need a Github API token to get all the tests to pass and for getting all the lesson content.

First create a application.yml with figaro, this is where you will store your Github API token.
```
$ rails generate figaro:install
```

Next go to [personal access tokens](https://github.com/settings/tokens) in your Github user account settings and click the "generate new token" button. This will bring you to a new page. Give your token a description in the box provided, Something like "Odin " will do. Once that is done click the "generate token" button at the bottom of the page. The token highlighted in green is your new Github API token.

Copy your Github API token and go back to the `config/application.yml` file in your local Odin Project directory. Paste your API token in place of `<your api token here>` like the example below:
```
GITHUB_API_TOKEN: <your api token here>
```

## Run the Tests
You can now run all the tests, they should all be green

To run the rspec unit tests:
```
$ rspec
```

To run the cucumber integration tests:
```
$ cucumber
```

## Seeding the Database and Populating the Lesson content
Next you need to seed the database with the course and lesson data.
```
$ rails db:seed
```
$ rails s

We pull in the lesson content from the Odin [curriculum repository](https://github.com/TheOdinProject/curriculum) on Github. We have created a rake task to do this easily.
```
$ rake rake curriculum:update_content
```

## Running the app locally
You can now run the app on your local machine.

start the server
`$ rails server`

Go to the app in your browser:
`http://localhost:3000`

## Setting up Github Omniauth (Optional)
We allow users to create an account on the site with Github OAuth. To get this feature working locally follow the instructions in this section.

Go to [OAuth Applications](https://github.com/settings/developers) in your Github user account settings and click the "register a new application" button.

Fill in the form fields with the following:

Application Name
`odin`

Homepage URL
`http://localhost:3000`

Application Description
`the odin project`

Authorization callback URL
`http://localhost:3000/users/auth/github/callback`

Click the "Resgister application" button. This will display your `Client ID` and `Client Secret` which is what you will use to get OAuth working on your local machine.

Go to `config/application.yml` in your local project directory for The Odin Project and fill in the following:
```
GITHUB_API_TOKEN: <your api token here>
GITHUB_APP_ID: <your client ID here>
GITHUB_SECRET: <your client secret here>
```

To test all this is working correctly, run the app locally and try to sign up with Github.

Go to your browser and voila!
## Need Help?
If you have any problems getting anything set up in this guide please let us know in our [contributing gitter channel](https://gitter.im/TheOdinProject/Contributing)

0 comments on commit 29f4f60

Please sign in to comment.