To make this problem go away, you could force everyone in your team to use the same OS and make sure everyone configures their machine exactly the same, but this is not always feasible, especially if you're developing an open source project that people all over the world might contribute to.
That is why I've decided to include a Vagrantfile and a puppet folder on all my projects.
If you take any number of blank computers (having nothing but a default OS installation) and run some Puppet scripts on them, all of them will end up having the exact same configuration.
With Puppet, you can automate pretty much anything you could do manually: install apps or libraries, set up databases, create user accounts, modify configuration files, etc.
Vagrant is a software used for creating and configuring virtual environments. You can think of it as a wrapper for Virtualbox or VMware. Instead of manually creating a virtual machine and setting up the OS to use, ports to forward, files to share, etc, you just write a Vagrantfile and let Vagrant do it for you.
Vagrant + Puppet
When we use these tools together, we have the perfect setup:
- Thanks to Vagrant we can make sure everyone is using the same OS
- Thanks to Puppet we can make sure everyone has the exact same configuration on their machine
And by taking advantage of Vagrant's shared folders and port forwarding, developers can still use their favorite text editor, IDE, and browser to do coding and debugging, but you won't have to deal with those "it doesn't work on my machine" issues anymore.
** On this post I provide a specific example: setting up a dev environment for a Node.js/MySQL application