Well, may be this will give you some help
require 'rbconfig.rb'
include Config
CONFIG["host"]
CONFIG["libdir"]