-
-
Save deepak/150500 to your computer and use it in GitHub Desktop.
rake task to install ruby
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
APTGET = "apt-get install -qqy" | |
RUBY19 = "ruby-1.9.1-p129" | |
SRC = "/usr/local/src" | |
WGET = "wget -q" | |
namespace :ruby do | |
desc 'download and compile Ruby 1.9' | |
task :install_19 do | |
deps = %w'zlib1g-dev libopenssl-ruby1.9' | |
version = RUBY19.gsub(/-p\d+$/,"") # remove patch level | |
run "#{APTGET} #{deps.join(' ')}" | |
cmd = [ | |
"cd #{SRC}", | |
"#{WGET} ftp://ftp.ruby-lang.org/pub/ruby/1.9/#{RUBY19}.tar.gz", | |
"tar zxvf #{RUBY19}.tar.gz", | |
"cd #{RUBY19}", | |
"./configure --prefix=/opt/#{version} --enable-shared", | |
"make", | |
"make install" | |
].join(" && ") | |
run cmd | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment