Skip to content

Instantly share code, notes, and snippets.

@kgrz
Created April 22, 2015 08:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save kgrz/a8e48d7b576928ba55cf to your computer and use it in GitHub Desktop.
Save kgrz/a8e48d7b576928ba55cf to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
require 'open-uri'
patchset = ARGV[0]
version = ARGV[1]
raise 'Please specify a patchset' if patchset.nil?
raise 'Please specify a ruby version' if version.nil?
patches = open("https://raw.githubusercontent.com/skaes/rvm-patchsets/master/patchsets/ruby/#{version}/#{patchset}").read.split("\n").map do |patch|
"-p https://raw.githubusercontent.com/skaes/rvm-patchsets/master/patches/ruby/#{version}/#{patch}"
end.join(" ")
puts "Installing ruby with #{`ruby-install --version`}"
puts "Available Rubies: #{`ruby-install`}"
`ruby-install #{patches} ruby #{version}`
__END__
Use this snippet like so:
./install_with_patches.rb railsexpress 2.2.0
This would install Ruby version 2.2.0 with the patchset https://github.com/skaes/rvm-patchsets/tree/master/patches/ruby/2.2.0/railsexpress
A patchset includes a set of patches.
A more detailed explanation: http://kgrz.io/ruby/2015/01/25/installing-patched-ruby-using-ruby-install.html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment