Environment Setup Tips & Tricks

This past week as I was trying to create a new Rails project, I kept running into gem issues.  It seemed like whatever gem I was trying to update wasn’t compatible with the other gemfiles/ Rails/ Ruby version I had.  I would find a fix and then encounter the problem again with a different gem.  This was a pretty uncomfortable situation for me to be in because I find that navigating my environment is like navigating a foreign country with no map and no guide.  So I decided to wipe my computer and start anew. I figured it was the only sure fire way I could learn a bit about my environment and fix these super confusing bugs.

I followed a tutorial I had used previously while at Turing with a few modifications.

  1. For text editor I downloaded atom (very similar to Sublime Text, except free and no annoying ads).
  2. I went with ZSH instead of BASH for my shell (more on that later).
  3. I debated a long time between going with RVM or RBENV and ultimately decided to stick with RVM, though word is on the street that Turing might switch to RBENV soon.

Apple OSX actually has both preinstalled into your computer, but you can choose which shell to use when in your terminal.  I decided to go with ZSH because it seemed like it had more features.  In my previous job, our environment included using oh-my-zsh as the framework on top of ZSH but I opted for Antigen because it seemed to get the job done without as many components and modifications added to my computer. (It’s easy to get lost in all of it.) If you like oh-my-zsh, this is a great guide.

I looked at a handful of dotfiles on GitHub, which as a side note is a pretty great resource for learning more about this world and decided to follow a peer’s dotfile because it had a wealth of options in terms of personalization and shortcuts.

Here’s the steps for the setup:

  1. Install ZSH through homebrew (better than the one that comes with OSX)
 brew install zsh 

2. Add homebrew version of ZSH as your default shell by adding it to your /etc/shells list

 sudo vim /etc/shells 

then add:

 /usr/local/bin/zsh 

to the bottom of the file

3.  Set default shell to zsh

 chsh -s/usr/bin/zsh 

As this was my first go at it, I would not advise following these exact steps, but I will say that I learned a good deal about my environment. In particular, I learned about the differences in shells and frameworks for shells. I also learned how to modify these files with aliases (something I was familiar with previously), and how to incorporate functions into shortcuts (something I was not familiar with).  A huge shout out to my co-worker/ devops guru Trey for the guidance on this one.

Leave a comment