#!/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