The learn-co
gem is a tool that simplifies the process of completing labs and
submitting your work in Canvas. Under the hood, this process consists of a
number of steps:
-
Fork (create your own copy of) the assignment's repo on GitHub.
-
Clone your copy of the repo down to your local machine.
-
Run a command (
npm install
for JavaScript labs,bundle install
for Ruby labs) to install any necessary dependencies for the repository (...tools others have built to make things easier for us). -
Run
npm test
(JavaScript) orrspec
(Ruby) to run tests. -
Use git commands to commit your changes and push them up to your repo on GitHub.
-
Submit a link to your GitHub repo in Canvas to get credit for completing the lab.
The learn-co
gem will handle several of these steps for you automatically,
substantially simplifying the workflow so you can focus your attention on
learning to code. You will learn how to complete and submit assignments using
the gem in the next section; for now, let's get it installed and ready to use.
To install the gem, open the "Terminal" application (or "Ubuntu" for WSL users) and run this command:
$ gem install learn-co
Before we can use the gem, we'll need to do two things:
- Connect your Flatiron School Portal account to GitHub
- Connect the local gem to your Flatiron School Portal account
- Open Flatiron School's Base Account Management page (https://base.flatironschool.com/account/manage)
- Connect your GitHub account to your Flatiron School Portal account
Your Account Management page should now look similar to this:
This step will ask you to do work both in your browser and your terminal.
- Open the "Terminal" application (or "Ubuntu" for WSL users).
- Type
touch ~/.netrc && chmod 0600 ~/.netrc
and press<Enter>
. (Note: you may be asked to enter your password.) - Open Flatiron School's Base Account Management page (https://base.flatironschool.com/account/manage)
- Click the icon under "OAuth Token" to reveal your GitHub OAuth token.
- Copy the string of characters under the "OAuth Token" header.
- Go back to the terminal, type
learn whoami
and press<Enter>
. - Paste the string of characters at the prompt and press
<Enter>
.
Type learn whoami
in the terminal. If you see a message with your name,
username, and email, continue to the next lesson, Verify and Troubleshoot Your
Environment Setup.