Back to the Basics..setting up your Dev Environment

Adam Nowland
4 min readMay 13, 2021

This was me..first day of bootcamp and having no idea how to set up my local environment for development. I had tried on my own and failed. Then on our first day(or first few days) we took some time and all set it up together. Every class that I have seen start after mine all had this exact same problem. So, whether you are a new programmer, a bootcamp starter, or just got a new computer and cant remember what the heck you need to do to get programming..well..here ya go!

  • ***Of note this will be for macbook, they are notorious for pushing updates that break these steps as well****

Step 1) iTerm2 → Download and install iTerm2, Once installed you will need to open iTerm2, go to profiles, open profiles, edit profiles, general, command, then make sure Login shell is selected. Close any terminals you have open and then re open.

Step 2) Homebrew → Open your newly installed iTerm2 then copy/paste

xcode-select --install ; /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"

If this installs correctly; you should be able to run:

which brew

and see something liek /usr/local/bin/brew popup!

Now lets get you some of those missing packages!

brew install git zsh gmp gnupg sqlite postgres

Step 3) Getting ruby up and running → We use ruby, but you can tailor this section coming up to whatever language you want to use; just make sure to look at the proper docs.

pgconf --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"

Hit ENTER! This will install rvm, which will allow us to use multiple version of ruby(ruby version manager).

Now try out:

command -v rvm

This should print out ‘rvm’!

Next,

rvm install 2.6.6
rvm use 2.6.6 --default

You can put in any version you want here to install and run as your default.

which ruby

This should now print something like: /home/your-name/.rvm/rubies/ruby-2.6.6/bin/ruby.

Perfect! Now lets do a little bit of ruby work and install a few gems that will help out in the long run. In iTerm2 still type:

gem update --system
gem pristine --all
gem install rails bundler pg nokogiri pry

If you are a flatiron student specifically you will want to install learn-co as well. You can just add that in in the ‘gem install rails bundler’ line.

Step 4) Node and NVM setup → NVM will allow us control over the version of node we are using just like RVM did for ruby.

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"

Copy and paste that into your terminal and then hit enter. Next run

command -v nvm

This should print out nvm.

Once that is setup, run:

nvm install node
nvm use node
nvm alias default node

And just like that NVM is all setup. Now lets get some packages installed for node.

npm install -g yarn lite-server create-react-app

To test to make sure install was successful, just try out ‘which lite-server’. If it prints out anything you should be good!

Step 5) Lets setup git now!

git config --global user.email "you@example.com"
git config --global user.name "Your Name"

Run those commands, obviously replacing it with your information.

Once that is done you will need to follow one of the two paths:

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

Step 6) Setting up ZSH →

sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

Once you run that command you will have a prompt to switch shells, hit Y. Close your terminal and re open and you should see a ‘~’ now on your command line.

Step 7) The last step! Lets make sure that Node and NVM work everytime you want them to! You will want to have installed VS Code or your favorite text editor. Run:

code ~/.zshrc

This will open your zsh file in VScode. Scroll to the bottom of the page and paste the following lines in the code then save it.

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

And you are all done!!!

This should give you basic developer functionally now on your computer! Let me know if it works!

--

--

Adam Nowland

Former foot and ankle physician. Current bootcamp student. All the time technology nerd.