Skip to content

Instantly share code, notes, and snippets.

Setting up and installing rbenv, ruby-build, rubies, rbenv-gemset, and bundler

This guide enables you to install (ruby-build) and use (rbenv) multiple versions of ruby, isolate project gems (gemsets and/or bundler), and automatically use appropriate combinations of rubies and gems.

TL;DR Demo

# Ensure system is in ship-shape.

aptitude install git zsh libssl-dev zlib1g-dev libreadline-dev libyaml-dev

@jcowhigjr
jcowhigjr / kick.sh
Created January 23, 2014 19:11 — forked from sosiouxme/kick.sh
#!/bin/sh
# This is a sample script for kickstarting a VM according to the openshift.ks script under virt-manager, qemu+KVM, and Linux.
# You certainly need to modify at least the CMDLINE and --location below for it to be useful (unless you work at Red Hat).
set -e
if [ $# -lt 1 ]
then
printf 'Usage: %s vm_name [arg1 [arg2 [...]]]\n' "$0"
@jcowhigjr
jcowhigjr / README.md
Last active August 29, 2015 13:56 — forked from terenceponce/README.md

Setting up Ruby, Rails, Nginx,and PostgreSQL 9 on Ubuntu 14.04 LTS

Last updated: 12 Feb 2014 Work in progress sources: "https://www.digitalocean.com/community/articles/how-to-install-ruby-on-rails-on-ubuntu-12-04-lts-with-rbenv--2" "http://10kb.nl/blog/setup-and-keep-up-with-the-latest-versions-of-a-complete-rails-dev-stack" "http://gorails.com/setup/ubuntu/13.10"

Fix the locale issue

  • Edit /etc/default/locale as sudo.
  • Append LC_ALL="en_US.UTF-8" at the end of the file, save and quit.
  • sudo locale-gen en_US en_US.UTF-8
$(document).ready(function(){
// Apparently I am not smart enough to figure out how to
// set the selected value on the new date_select form helper in Rails 4
// So, I had to create a client side solution
var url = document.location.href.split("?")[1];
// If the url does not have a query string
// Nothing else matters
if(url) {
var params = url.split("&");
@jcowhigjr
jcowhigjr / ask.sh
Last active August 29, 2015 14:27
Bash: General-purpose Yes/No prompt function ("ask")
# This is a general-purpose function to ask Yes/No questions in Bash, either
# with or without a default answer. It keeps repeating the question until it
# gets a valid answer.
ask() {
# http://djm.me/ask
while true; do
if [ "${2:-}" = "Y" ]; then
prompt="Y/n"