Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
52 lines (41 sloc) 2.06 KB
#!/usr/bin/env bash
# This is an RVM Project .rvmrc file, used to automatically load the ruby
# development environment upon cd'ing into the directory.
# For more info, see:
echo "RVM: Using ${ruby_gemset_name} for this project."
# Ensure we have the right ruby installed to use this project.
if rvm list strings | grep -q "${ruby_name}" ; then
# Load or create the specified environment
# We attempt to load the desired environment directly from the environment
# file. This is very fast and efficient compared to running through the entire
# CLI and selector. If you want feedback on which environment was used then
# insert the word 'use' after --create as this triggers verbose mode.
if [[ -d "${rvm_path:-$HOME/.rvm}/environments" \
&& -s "${rvm_path:-$HOME/.rvm}/environments/${ruby_gemset_name}" ]] ; then
\. "${rvm_path:-$HOME/.rvm}/environments/${ruby_gemset_name}"
# If the environment file has not yet been created, use the RVM CLI to select.
if ! rvm --create "${ruby_gemset_name}"
echo "RVM: Failed to create environment '$environment_id'."
# Ensure that Bundler is installed, install it if it is not.
bundler_installed=`gem list bundler | grep bundler`
if [ -z "$bundler_installed" ]; then
gem install bundler
# Bundle while reducing excess noise.
# We generate bin stubs so that we don't need to use
# 'bundle exec' before gem executables. You should add
# './bin' to your path so that you can run 'rake', 'cucumber'
# etc from the Gemfile with ease.
# See
echo "RVM: Ensuring your bundle is up to date."
bundle install | grep -v 'Using' | grep -v 'complete' | sed '/^$/d'
# Notify the user to install the desired interpreter before proceeding.
echo "RVM: ${ruby_name} was not found, please run 'rvm install ${ruby_name}' and then cd back into the project directory."