This is a special variable in ruby. Ruby special variables start with the dollar sign followed by a single character. This particular variable is the default search path for load or require. If you call it in irb or the rails console, you can see it returns an array of strings which are paths.
Since it returns an array, the unshift is simply an array method that adds an object to the beginning of an array.
An example of this can be seen in the ActiveRecord source (2.3.2 rails). In this particular example, the ActiveSupport path is prepended to the array, so that it can be required in the code.
activesupport_path = "#{File.dirname(__FILE__)}/../../activesupport/lib"
if File.directory?(activesupport_path)
$:.unshift activesupport_path
require 'active_support'
end
There are a bunch of other special variables in ruby like this one. Take a look here for more info: http://www.zenspider.com/Languages/Ruby/QuickRef.html#18



