Created
June 10, 2017 16:35
-
-
Save majormoses/695432b917bb0568c570cc3564757a20 to your computer and use it in GitHub Desktop.
Install xmlrpc on ruby versions >= 2.4
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
# This file needs to be named mkrf_conf.rb | |
# so that rubygems will recognize it as a ruby extension | |
# file and not think it is a C extension file | |
require 'rubygems/dependency_installer.rb' | |
# Load up the rubygem's dependency installer to | |
# installer the gems we want based on the version | |
# of Ruby the user has installed | |
installer = Gem::DependencyInstaller.new | |
begin | |
if RUBY_VERSION >= "2.4" | |
installer.install "xmlrpc", "~> 0.3" | |
end | |
rescue | |
# Exit with a non-zero value to let rubygems something went wrong | |
exit(1) | |
end | |
# If this was C, rubygems would attempt to run make | |
# Since this is Ruby, rubygems will attempt to run rake | |
# If it doesn't find and successfully run a rakefile, it errors out | |
f = File.open(File.join(File.dirname(__FILE__), "Rakefile"), "w") | |
f.write("task :default\n") | |
f.close |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment