This one is pretty simple too, and very easy. Specify the version of the gems you are using in the Gemfile. Or in your environment.rb if you are into Rails Archaelogism. Wait, SPECIALLY if you鈥檙e dealing (or know that someone will) with old projects.
Let鈥檚 say you start developing a project and you want to use a gem.
gem "capistrano-tasks" # shameless plug LOLAt that time, you鈥檒l probably just go with whichever version rubygems throws at you. That鈥檚 ok. But when you deploy into staging for the first time, make sure to note down the version of the gem that鈥檚 being used in the staging machine and specify that version in the Gemfile.
gem "capistrano-tasks", "~> 0.1.0" # shameless plug LOLYou鈥檒l make your life a little easier when going into production for the first time because you鈥檒l be using the same gem version (and dependencies), and A LOT easier for the next guy in line trying to get the project up and running.
Be a good guy and just try to think a little in advance and be nice to the future devs, or your future self. Anyway, it seems that you鈥檙e going to need to do this in Rails 4.