Created
April 22, 2015 08:54
-
-
Save kgrz/a8e48d7b576928ba55cf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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