Skip to content

Instantly share code, notes, and snippets.

View noteflakes's full-sized avatar

Sharon Rosner noteflakes

View GitHub Profile
@adamjmurray
adamjmurray / gist:3154437
Created July 21, 2012 03:18
Managing Ruby gems programmatically
# Environment, set GEM_HOME & GEM_PATH. For example, we can launch JRuby like this:
# GEM_HOME=/Users/amurray/tmp/gems/ GEM_PATH=/Users/amurray/tmp/gems java -jar ~/Downloads/jruby-complete-1.7.0.preview1.jar -S irb
# =====================
# LISTING gems
puts Gem::Specification.find_all.to_s
puts Gem::Specification.find_all.map{|spec| "#{spec.name} (#{spec.version})" }
# =====================
# USING (a specific version of) gems