sant0sk1 (owner)

Forks

Revisions

gist: 122553 Download_button fork
public
Public Clone URL: git://gist.github.com/122553.git
Embed All Files: show embed
install_ruby_19.rb #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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