Best way to set up a common environment for using Rails


I would like to work on a ruby on rails project with a group of 4 people. If we install rails 4.2.0 how can we ensure that we all share the same environment? Is the only option to have install VM? or is there some other way? I mean what if one user is using mac another is on windows and another is on Linux? How can we ensure all are having same environment so there is no configuration issues etc? What is the easiest solution?

As @MarcBaumbach stated above tools like Vagrant, Docker and Puppet are built for this. In my experience your environment do not need to be identical. I work on a Mac at work, Fedora at home and I have a teammate in India who uses Ubuntu. Specifying the Ruby version as well as the Rails version in the gemfile works well.


ruby '2.2.0'

gem 'rails', '4.1.4'