Class: Migrant::Bootstrappers::RubyLocal192

Inherits:
Base
  • Object
show all
Defined in:
lib/migrant/bootstrappers/ruby_local_192.rb

Overview

Installs Ruby 1.9.2 into /usr/local

Instance Method Summary collapse

Methods inherited from Base

default, default_bootstrapper, register, registered

Constructor Details

#initialize(env) ⇒ RubyLocal192

Returns a new instance of RubyLocal192.



7
8
9
# File 'lib/migrant/bootstrappers/ruby_local_192.rb', line 7

def initialize(env)
  super
end

Instance Method Details

#bootstrapped?Boolean

Returns:

  • (Boolean)


26
27
28
29
# File 'lib/migrant/bootstrappers/ruby_local_192.rb', line 26

def bootstrapped?
  result = @environment.server.ssh('/usr/local/bin/chef-solo --version')
  result[0].status == 0
end

#runObject



11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/migrant/bootstrappers/ruby_local_192.rb', line 11

def run
  commands = [
    'sudo apt-get update',
    'sudo apt-get install -y build-essential wget build-essential bison openssl libreadline5 libreadline-dev ' +
    'curl git-core zlib1g zlib1g-dev libssl-dev vim libsqlite3-0 libsqlite3-dev ' +
    'sqlite3 libreadline-dev libxml2-dev autoconf',
    'rm -rf /tmp/ruby-build',
    'git clone git://github.com/theaboutbox/ruby-build.git /tmp/ruby-build',
    'cd /tmp/ruby-build && sudo ./install.sh',
    'sudo ruby-build 1.9.2-p290 /usr/local',
    'sudo gem install bundler chef'
  ]
  @environment.cloud.execute commands
end