Skip to content

Commit a7c0dbb

Browse files
committed
Install RubyGems from source on Ubuntu 10.04
1 parent ef99331 commit a7c0dbb

File tree

2 files changed

+37
-1
lines changed

2 files changed

+37
-1
lines changed

modules/ruby/manifests/binary/linux.pp

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,23 @@
33
ensure => installed,
44
}
55

6-
if $operatingsystem != 'Archlinux' {
6+
if $lsbdistid == 'Ubuntu' and $lsbmajdistrelease == '10' {
7+
# On Ubuntu 10 we need to install RubyGems from scratch, because
8+
# the one they have in packages are too old. We just use a script
9+
# for this because of laziness.
10+
util::script { "install-rubygems":
11+
path => "/usr/local/bin/install_rubygems_from_source",
12+
content => template("ruby/install_rubygems_from_source.sh.erb"),
13+
}
14+
15+
exec { "/usr/local/bin/install_rubygems_from_source":
16+
unless => "test -f /usr/bin/gem",
17+
require => [
18+
Package["ruby"],
19+
Util::Script["install-rubygems"],
20+
],
21+
}
22+
} elsif $operatingsystem != 'Archlinux' {
723
package { "rubygems":
824
ensure => installed,
925
}
@@ -24,5 +40,11 @@
2440
ensure => installed,
2541
}
2642
}
43+
44+
'Ubuntu': {
45+
package { "ruby-dev":
46+
ensure => installed,
47+
}
48+
}
2749
}
2850
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/usr/bin/env bash
2+
#
3+
# This installs RubyGems from source.
4+
5+
FILE="rubygems-1.8.25"
6+
7+
cd /tmp
8+
wget http://production.cf.rubygems.org/rubygems/${FILE}.tgz
9+
tar xzvf ${FILE}.tgz
10+
cd ${FILE}
11+
sudo ruby setup.rb
12+
13+
# Symlink to the `gem` binary
14+
sudo ln -s /usr/bin/gem1.8 /usr/bin/gem

0 commit comments

Comments
 (0)