Skip to content

Instantly share code, notes, and snippets.

@Darkside73
Created July 24, 2014 09:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Darkside73/05560a085522f0cfbe15 to your computer and use it in GitHub Desktop.
Save Darkside73/05560a085522f0cfbe15 to your computer and use it in GitHub Desktop.
Create rails application with rvm gemset
#! /bin/sh
source "$HOME/.rvm/scripts/rvm"
app_name=$1
rvm default
current_ruby=`rvm current`
echo "Creating gemset ${app_name}..."
rvm gemset create $app_name
gemset="${current_ruby}@${app_name}"
echo "Installing rails gem..."
rvm $gemset do gem install rails
echo "Creating rails application ${app_name}..."
rvm $gemset do rails new $@
echo "Write rvm dot files..."
cd $app_name && echo $current_ruby > .ruby-version && echo $app_name > .ruby-gemset
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment