I’m pretty sure everyone at some point has tried to run a local project and suddenly it stopped working. Then, you are forced to stop working to find out why. You would spend precious minutes or even hours trying to fix it. This painful and unnecessary problem can frequently occur if you don’t know how to avoid it.

The lack of experience and improper setup of the development environment can be the causes of those issues, but there’s one more thing that is usually forgotten. I think some people are not even aware of this, but leaving their development environment outdated will give them headaches later on.

Let’s suppose you just got a brand new bike. It’s beautiful and everything is working smoothly. However, as the time goes by, if you do not keep a regular maintenance on your bike, the chains will get rusted, the brakes might stop to work and the tires will get flatten. And the longer maintenance is delayed, the more problems you might have with your bike.

Rusted Bike

Well, the bike example can be applied to your development environment and software. If you don’t maintain them updated, sooner or later you will have issues.

But there are simple things you can do to avoid getting your development environment rusted and I’ll share them with you now.

Keep your OS up-to-date

First things first: If your Operation System is outdated, you can stop reading here. Come back after you update your OS. :)

Another important thing you need to verify is that you have the latest version of Command Line Tools. If you downloaded Xcode on the app store, it will be easy to know if there’s an update, but if you installed only the Command Line Tools, without Xcode, you can enter the following line on your terminal:

xcode-select --install

Update your development environment recurrently

I’m using a to-do app to remind me to update my environment every two weeks (Yes, I love updates). You can set a different recurring time and use whatever tool works best to remind you.

To-do App

I have created a list with all the snippets that I need to run in order to keep our development environment up-to-date. Here’s our current development stack here at Startaê (RubyGems, Homebrew, RVM, Ruby, Git, Bower, NPM, Node.js).

Update Homebrew

brew update && brew doctor

Update RVM

rvm get head && rvm cleanup all

RubyGems

gem cleanup && gem update --system

Update Ruby

rvm list default && rvm install ruby --latest && rvm use --latest --default && ruby -v

Update Git using Homebrew

git --version && brew upgrade git

Update Bower

bower -v && bower cache clean && npm update -g bower

Update Yarn

brew upgrade yarn

Update NPM

npm -v && npm update -g

Update Node.js via NPM

node -v && npm cache clean && npm install -g n && n stable


or, if you’re using NVM…

nvm install stable

What are your habits to keep your dev environment running smoothly?

I’m currently looking for solutions that could help automate this process. Especially a solution that could be replicated to other team members.

I’m sure there are other ways to keep the development environment up-to-date. Do you have any suggestion? I’d love to hear how you do it.

Happy coding!