Skip to content

Instantly share code, notes, and snippets.

@jcf
Created April 3, 2012 16:17
Show Gist options
  • Save jcf/2293305 to your computer and use it in GitHub Desktop.
Save jcf/2293305 to your computer and use it in GitHub Desktop.
Bootstrap a Ruby app that uses Bundler
#!/bin/bash
echo "Checking for Ruby..."
type -P ruby &>/dev/null || { echo >&2 "Ruby not found in PATH. Exiting."; exit 1; }
echo "Checking for Bundler..."
gem which bundler &>/dev/null || gem install bundler
echo "Installing gem dependencies..."
bundle install
# Snippet for use with Vim & UltiSnips
snippet bs
echo "Checking for Ruby..."
type -P ruby &>/dev/null || { echo >&2 "Ruby not found in PATH. Exiting."; exit 1; }
echo "Checking for Bundler..."
gem which bundler &>/dev/null || gem install bundler
echo "Installing gem dependencies..."
bundle install
$0
endsnippet
@jcf
Copy link
Author

jcf commented Apr 3, 2012

This assumes you've got Ruby and rubygems installed.

This is no longer true. I've added a check to make sure Ruby is present within PATH.

@jcf
Copy link
Author

jcf commented Apr 8, 2012

…and just to be safe, I've switched to using Bash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment