Skip to content

Instantly share code, notes, and snippets.

@deepak
Forked from jerodsanto/install_ruby_19.rb
Created July 20, 2009 18:43
Show Gist options
  • Save deepak/150500 to your computer and use it in GitHub Desktop.
Save deepak/150500 to your computer and use it in GitHub Desktop.
rake task to install ruby
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