Skip to content

Instantly share code, notes, and snippets.

@ssmythe
Last active August 29, 2015 14:22
Show Gist options
  • Save ssmythe/42232d06ca5ffbe92016 to your computer and use it in GitHub Desktop.
Save ssmythe/42232d06ca5ffbe92016 to your computer and use it in GitHub Desktop.
RVM project specific rubies and gems
# install RVM
\curl -sSL https://rvm.io/mpapis.asc | gpg2 --import -
\curl -sSL https://get.rvm.io | bash -s stable
# set up project specific rubies and gems option
echo "export rvm_project_rvmrc=1" > $HOME/.rvmrc
echo "export rvm_install_on_use_flag=1" >> $HOME/.rvmrc
echo "export rvm_gemset_create_on_use_flag=1" >> $HOME/.rvmrc
# read in RVM config to running environment
source ~/.rvm/scripts/rvm
# once in project directory, create rvm config files
echo "ruby-2.0.0-p481" > .ruby-version
echo "project_name" > .ruby-gemset
# sample Gemfile
cat - >Gemfile <<EOF
source 'https://rubygems.org'
gem 'capistrano', '2.15.5'
EOF
#-----------------------
# In a Jenkins job, use:
#-----------------------
#!/bin/bash
source ~/.rvm/scripts/rvm
rvm use `cat .ruby-version`@`cat .ruby-gemset`
set -e
bundle install
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment