#!/usr/bin/env bash ruby_string="ruby-1.9.3" gemset_name="jekyll-blog" if rvm list strings | grep -q "${ruby_string}" ; then if [[ -d "${rvm_path:-$HOME/.rvm}/environments" \ && -s "${rvm_path:-$HOME/.rvm}/environments/${ruby_string}@${gemset_name}" ]] ; then \. "${rvm_path:-$HOME/.rvm}/environments/${ruby_string}@${gemset_name}" else if ! rvm --create "${ruby_string}@${gemset_name}" then echo "Failed to create RVM environment '${ruby_string}@${gemset_name}'." fi fi if ! command -v bundle ; then gem install bundler fi if [[ -e Gemfile ]]; then bundle install fi else echo "${ruby_string} was not found, please run 'rvm install ${ruby_string}' and then cd back into the project directory." fi