Note for online students: We do not provide support for enrvonment issues if you set up a local environment using a Mac. For supported environment options, please read this article: http://help.learn.co/the-learn-ide/the-basics-of-the-learn-ide/using-the-ide-versus-a-local-environment
The following instructions are for students who are preparing to take the immersive, in person programs at Flatiron school.
Step 1 - Uninstall the Learn IDE
For detailed instructions on how to properly uninstall the IDE, please read this Help Center article.
Step 2 - Download Xcode Command Line Tools ( For Mac Users)
Open up your Terminal. This is where we are going to be doing most of our installation steps! On Mac, you can open up your terminal by going to Applications > Utilities > Terminal, or by using the quick launch (
cmd + space) and just start typing “Terminal”.
In terminal, type
xcode-select --install to install the Xcode command line tools.
If you get a message that the command line tools are already installed, that is fine.
Step 4 - Install Homebrew
Install the Homebrew package manager. You can do this by entering the following command into your terminal:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Note, this is all one line in the terminal even if it is broken up into two lines here in your browser.
Step 5 - Get git and set it up
- Make sure you have git. It generally comes pre-installed with most operating systems, but you can check by running
git versionon terminal. If this gives you an error or does not come back with version number, you'll need to install git. you can get it by typing
brew install giton your terminal.
ssh-keygento create a new SSH key. If you do not already have an SSH key setup, you’ll be asked to select a location and a passphrase. Just leave everything blank and press enter for default location and no passphrase. If you’re asked if you want to overwrite, then you already have an SSH key and you do not want to overwrite it.
cat ~/.ssh/id_rsa.pubThis will display your SSH key to your terminal. You want to then copy this and add this SSH key to your github by following the instructions posted on GitHub.
You’re also going to want to let the git that is running on your machine to know you you are. You can set this up by running:
git config --global user.email "email@example.com" and
git config --global user.name "Your Name"
Step 6 - Support Libraries
Next we’re going to add a few support libraries with the following lines:
brew install gmp and
brew install gnupg Note: If you get the following error:
Warning: gnupg-1.4.19 already installed, it’s just not linked simply run:
brew link gnupg.
Step 7 - Install Ruby Version Manager
RVM is a great tool that lets you run different versions of Ruby on your computer. This is really useful because if you know one project you're working on works with Ruby version 2.1.0 and another needs 2.3.3, you can easily switch between the two versions when you switch between projects. You can install it and set it up with the following commands:
curl -sSL https://get.rvm.io | bash-make sure you do not use
- ONCE THIS STEP COMPLETES, CLOSE AND RE-OPEN YOUR TERMINAL. If you skip this step, RVM will not work.
rvm install 2.3.3
rvm use 2.3.3 --default
- Check that everything worked by running
rvm list. This should output the version of ruby you’re using (2.3.3) and the list of versions available with your RVM install.
Step 8 - Install some ruby gems
Ruby gems are pre-written, stand-alone, chunks of code that have been made easily accessible to you.
- First, let's update our system gems with:
gem update --system
- Install the Learn gems. Do this with:
gem install learn-co.
- Install the gem bundler. This gem takes care of installing all the other gems you need for projects:
gem install bundler
Step 9 - Set Up the Learn gem
Now we need to setup the Learn gem. Type the following into your terminal:
This will prompt you to set up the Learn gem.
Note: When the gem asks you to go to
learn.co/your-github-username , you must fill your username into the URL and be logged in to be able to retrieve your token.
Step 10 - Get a Text Editor
Get a Text Editor. We suggest Atom Text Editor
Once you have Atom installed, you can set it as your default text editor in the learn-config file. First, open up the config file for your learn gem with
You can then change your editor from
You can also set the default location that Learn will save all your labs. Save and close the file. Note: These settings only trigger when you use the Open button in Learn or when you use the
learn open command. You can always manually clone your labs to any location you wish and open them with any text editor without having to edit this config file.
Make sure Atoom appears in your
Applications folder. If it does not, it may still be in your default downloads folder. Open finder and navigate to
Downloads (or wherever you save downloads). If you see Atom there, make sure to drag it over to
Once Atom is in your applications folder, launch the program, and click on
atom in the navbar at the top of your screen. Then click
Install Shell Commands.
Step 11 - Install some more gems!
If you’re going to be doing web development on Learn, you’re going to want to install a couple more gems.
- Phantom JS is a JavasScript library and this ruby gem easily installs it for you:
gem install phantomjs
- Nokogiri is a gem that let’s us scrape websites and you’ll definitely want to be able to use it. Let’s install it with:
gem install nokogiri.If you encounter any errors while install this gem, check out the Nokogiri support docs for Mac OSX installs. If you check out that page an you still have issues, contact support for help.
Step 12 - Get some databases
You’ll be using a couple of different databases as you move through the web development track. The default database that rails uses is SQLite. We also frequently see that students want to deploy their apps to the free hosting service Heroku. To do this though, you’ll need to be using Postgres instead. It’s best if we just install both of them now so you can use either one.
brew install sqlite
- Postgres: Install the Postgres app at: Postgres.app
Step 13 - Install Rails
Finally, rails! The powerful ruby web framework. We can install that with:
gem install rails
Step 14 - Dotfiles (Optional)
These dotfiles do a variety of different things and I highly recommend you download them. If when you’re trying to back up the files you get the error ‘No such file or directory’, don’t worry. This just means you didn’t have one of these files to start with, so there is nothing to backup.
- Back up your .irbrc file with
curl "https://raw.githubusercontent.com/flatiron-school/dotfiles/master/irbrc" -o "$HOME/.irbrc"- This file gives you some nice formatting for when you’re in IRB (IRB lets you write ruby code in your terminal)
- Back up your .gitignore file with
curl "https://raw.githubusercontent.com/flatiron-school/dotfiles/master/ubuntu-gitignore" -o "$HOME/.gitignore"- Global .gitignore rules. When you add a .gitignore file to a project, it let’s you specify certain files that you DO NOT want pushed up to github (like API keys…)
- Back up your .bash_profile file with
curl "https://raw.githubusercontent.com/flatiron-school/dotfiles/master/bash_profile" -o "$HOME/.bash_profile"- Your bash profile loads up every time you open a terminal window. The Learn bash_profile is designed to load up a bunch of shortcuts for you as well as make sure that RVM loads up every time you open the terminal. I recommend you take a look at this file and even see if there are any shortcuts of your own that you’d like to add! Note: this will overwrite existing bash profile, so back up if you want to.
- Back up your .gitconfig file with
curl "https://raw.githubusercontent.com/flatiron-school/dotfiles/master/gitconfig" -o "$HOME/.gitconfig"then
atom ~/.gitconfig(you can access this file with the editor of your choosing) and edit what needs to be edited (github username and github email in a few places).
Step 15 - Node
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.2/install.sh | bashon terminal. Make sure you do not use sudo.
- Then run
echo 'export NVM_DIR="$HOME/.nvm"' >> ~/.bash_profile.
- As well as
echo '[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"' >> ~/.bash_profile.
source ~/.bash_profile. This will refresh your shell after making these changes. This way you wont have to quit terminal and open it again.
- Finally, run
nvm install 6.11.2to get the latest 6.x version of node.
Step 16 - Install Java Next, we’ll want to install the latest version of the Java Development Kit. To get that, head on over to the download page and select the Java SE Development Kit for Mac OSX and install it.
Step 18 - Install Slack for Mac and enable desktop notifications for slack. You'll need to sign in to the Flatiron School workspace:
flatiron-school.slack.com using the email address that Flatiron has provided you (
FirstName.LastName@flatironschool.com ). The Slack sign up information will also be in your welcome email.
Step 19 - (Optional) Turn up your key repeat. Open
System Preferences by clicking the apple icon in the top left corner of your screen and selecting
System Preferences. Then Click
Keyboard and make sure both
Key Repeat and
Delay Until Repeat are turned up all the way. This will allow you to move your cursor through text much faster.