Skip to content
Create a gist now

Instantly share code, notes, and snippets.

rvmrc file that controls the version of Ruby, the Gemset, Rubygems, and Bundler. Use this if you want to control this stuff in your development workflow.
#!/usr/bin/env bash
# Bare minimum Gems that are needed to keep a Ruby development environment in sync. This assumes
# that you use bundler in your workflow to control the installation of all other gems. If you need
# to bump the bundler or rubygem version across your team, change that here, then run bundler and
# and keep going.
# Make this work with OS X Lion... for now...
if [[ `uname -v` =~ "Darwin Kernel Version 11" ]] ; then
export CC=/usr/bin/gcc-4.2
# # Make sure we're using the right version for ruby
rvm use --create --install $RVMRC
# Enforce a version of Rubygems
if [[ `gem --version` != $RUBYGEM_VERSION ]] ; then
echo "Updating to RubyGems $RUBYGEM_VERSION..."
rvm rubygems $RUBYGEM_VERSION
# Check if bundler is installed
if [[ "command -v bundle" ]] ; then
# Check if we have the right version
if [[ ! (`bundle --version` =~ $BUNDLER_VERSION) ]] ; then
echo "Updating to Bundler $BUNDLER_VERSION..."
gem install bundler -v$BUNDLER_VERSION
echo "Installing Bundler $BUNDLER_VERSION..."
gem install bundler -v$BUNDLER_VERSION
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.