Isn’t this what got discussed in: Development, Test, and Production Environments?
with it you can do something like this for REQUIRE:
gem 'httparty'
group :development, :test do
gem 'better_errors'
end
group :production do
gem 'postgres'
end
// edit: i just used a gemfile instead of a require file because i had one on hand