Watch a Video of These Instructions for MacOS
Welcome student! Before we embark, let's turn your computer from a software consumer computer to a software developer computer. Follow each of these instructions in order. If something doesn't work, stop and try the step again. If it's still not working, ask an instructor for help before you move on!
Note: When you copy/paste a command from this page to your terminal, you may need to hit enter after everything looks like its run!. You might still have commands that need to run!
Your terminal (which sometimes you'll hear referred to as a "shell" or "the command line" or a "CLI") will be your primary means of interacting with your computer in the program. This will take the place of navigating through file folders, downloading installers, and running programs by clicking on icons.
- Download and install iTerm2
- Open iTerm2
- Go to Profiles -> Open Profiles -> Edit Profiles -> General -> Command, and make sure "Login shell" is selected
- Close any open terminals with Command + Q, and reopen them
The default terminal for Ubuntu (GNOME Terminal) will work for this program. Make sure the following option is checked:
☰ -> Preferences -> Profiles -> Your Name -> Command -> Run command as a login shell
For consumer software, you're probably used to going to a website, downloading a file, and running it on your computer to install it. For developer software, we use package managers to automate a lot of this.
Install Homebrew by running this command on your terminal:
xcode-select --install ; /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
If you did this right, you should be able to run:
which brew
and something like /usr/local/bin/brew
print out to your screen. If you didn't see anything print out to your screen, Brew didn't install correctly.
You already have a package manager installed called apt
!
Now, we'll use our package manager to download some helpful software we'll use in the program.
Run:
brew install git zsh gmp gnupg sqlite postgres
Run:
sudo apt update
sudo apt install git zsh gnupg sqlite postgresql postgresql-contrib
We'll use a tool called rvm
to have greater control over which version of ruby we're using.
Run this command:
gpgconf --kill all
gpg --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
\curl -sSL https://get.rvm.io | bash -s stable --auto-dotfiles
export PATH="$PATH:$HOME/.rvm/bin"
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"
Remember to hit enter after everything is done!
Close out of all open terminal windows with Command + Q. Then, reopen iterm2.
If this worked correctly, running this in your console should print rvm
:
command -v rvm
Then, run:
rvm install 2.6.6
rvm use 2.6.6 --default
Remember: Hit enter after you're done to be sure both commands ran!
If this worked correctly, running this command:
which ruby
should print something that looks like /home/your-name/.rvm/rubies/ruby-2.6.1/bin/ruby
and not something like /bin/ruby
.
Gem is another package manager, like Homebrew. We'll use brew
for installing software for our computer, and we'll use gem
for installing software for our projects.
IMPORTANT NOTE: Never sudo gem install
a gem. Gems can be published by well-intentioned developers, geniuses, students, and criminals. At any rate, you probably don't want to give them complete control over your computer.
gem update --system
gem pristine --all
gem install rails learn-co bundler pg nokogiri pry
Hit enter when you're done!
If running:
which rails
prints something like /home/your-name/.rvm/gems/ruby-2.6.6/bin/rails
, you're probably in good shape!
Just like rvm gives us more control over which version of Ruby is installed, nvm does that for Node.
Run the following command in your terminal:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash
export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
Hit enter when you're done!
If this worked, the following command should print nvm
:
command -v nvm
If that worked, run the following command in your terminal:
nvm install node
nvm use node
nvm alias default node
Hit enter when you're done!
Another package manager? Yep! Gem is for installing packages written in Ruby, and npm is is for installing packages written in JavaScript.
Run the following command in your terminal:
npm install -g yarn lite-server create-react-app
If running:
which lite-server
prints something to the screen, you're probably in good shape!
Run these commands, swapping you you@example.com
and Your Name
for your actual email and name.
git config --global user.email "you@example.com"
git config --global user.name "Your Name"
Follow these steps to connect your computer to Github:
- Check if you have an SSH key for your computer: https://docs.github.com/en/github/authenticating-to-github/checking-for-existing-ssh-keys
- If you do not add one by following all of these steps: https://docs.github.com/en/github/authenticating-to-github/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent
Run:
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
When it asks you if you want to switch your shell over to zsh, type "y" and hit enter.
Then close all open instances of your terminal. When you reopen your terminal, your command prompt should have a colored ~
on it.
Run:
learn whoami
And follow the instructions. Make sure you update the link with your GitHub username.
You'll spend most of your time in the program in your text editor. If you already have a preference, keep using it! Switching text editors, even with the same file, is not a big deal. If you're looking for a suggestion, VS Code is a good place to start.
Download and install VS Code
Run the following commands:
sudo apt update
sudo apt install software-properties-common apt-transport-https wget
wget -q https://packages.microsoft.com/keys/microsoft.asc -O- | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main"
sudo apt update
sudo apt install code
Run:
code ~/.zshrc
- Scroll down to the bottom of the file.
- Paste all 3 of these lines at the bottom of the file:
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
Yay! You're done!! 🙌 💃 Take a break, get a drink of water, and happy coding!!