I've been working on a small rails application and I've been wondering about the best way to have a development environment almost as identical as the production environment this app would run on. There are a few ways that I've seen around this, like normalizing environments by vendoring all the gems, setting ruby version files, versioning every gem you use in the Gemfile (which is a VERY recommended practice by the way). But all of this revolves around the rails project itself. We should also keep in mind all the things that affect our project, like the db version we use, if we use redis, or any other external service.
This is why I decided to give a try to docker, since in my experience I've always installed and bundled my apps directly on my machine.
Here are some of the things I learned in the process.
I believe this is something that has changed so much in the last few years. And as the time goes, communities improve their way of doing this things. I had my experience with Docker for Mac and I really liked how easy it is to install it. I believe it would be the same thing as running brew cask install docker
but wanted to point out that other option in case it could be useful for someone.