Skip to content

Instantly share code, notes, and snippets.

@rodreegez
rodreegez / gist:1818506
Created February 13, 2012 17:36
Ruby 1.9.2 Load paths

via Gregory Brown (@seacreature) on Twitter:

Wrong way to deal with the 1.9.2 removal of . from the loadpath:

  1. require "./foo/bar" forces you to run code from your project root
  2. $LOAD_PATH.unshift(".") recreates security issue, and pollutes

Right way to deal with the 1.9.2 removal of . from the loadpath:

  1. require_relative "foo/bar" if you don't need Ruby 1.8 compatibility

Coding Rails with Homebrew

Right now, this assumes you are using Snow Leopard.

Install Homebrew

Homebrew is MacPorts (or APT) without the suck. http://github.com/mxcl/homebrew