/
requirements
executable file
·343 lines (276 loc) · 12.6 KB
/
requirements
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
#!/usr/bin/env bash
( # wrap color reseting
if ! typeset -f rvm_pretty_print >/dev/null 2>&1
then source "${rvm_scripts_path:-"$rvm_path/scripts"}/functions/logging"
fi
rvm_pretty_print stdout || unset rvm_error_clr rvm_warn_clr rvm_debug_clr rvm_notify_clr rvm_reset_clr
system="$(uname)"
if [[ "Linux" == "$system" ]] || [[ "$(uname|tr a-z A-Z)" =~ "BSD" ]]
then
if
[[ -f /etc/lsb-release ]] && release="$( grep "^DISTRIB_DESCRIPTION=" /etc/lsb-release )"
then
release="${release#*=}"
elif
[[ -f /etc/os-release ]] && release="$( grep "^PRETTY_NAME=" /etc/os-release )"
then
release="${release#*=}"
elif
[[ -f /etc/debian_version ]]
then
release="Debian $(cat /etc/debian_version)"
else
for file in /etc/*-release
do
[[ -r $file ]] || continue
release="( $(cat $file) )"
break
done
fi
printf "%b" "
Requirements for ${system} $release
"
rvm_apt_binary="$( builtin command -v apt-get )"
rvm_emerge_binary="$( builtin command -v emerge )"
rvm_pacman_binary="$( builtin command -v pacman )"
rvm_yum_binary="$( builtin command -v yum )"
rvm_zypper_binary="$( builtin command -v zypper )"
rvm_pkg_add_binary="$( builtin command -v pkg_add )"
rvm_free_ram_mb="$(free -m | awk '{if (NR==3) print $4}')"
printf "%b" "
NOTE: 'ruby' represents Matz's Ruby Interpreter (MRI) (1.8.X, 1.9.X)
This is the *original* / standard Ruby Language Interpreter
'ree' represents Ruby Enterprise Edition
'rbx' represents Rubinius
bash >= 4.1 required
curl is required
git is required (>= 1.7 for ruby-head)
patch is required (for 1.8 rubies and some ruby-head's).
To install rbx and/or Ruby 1.9 head (MRI) (eg. 1.9.2-head),
then you must install and use rvm 1.8.7 first.
"
if [[ -n "$rvm_apt_binary" ]]
then
printf "%b" "
Additional Dependencies:
# For Ruby / Ruby HEAD (MRI, Rubinius, & REE), install the following:
ruby: ${rvm_apt_binary} install build-essential openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison subversion pkg-config
# For JRuby, install the following:
jruby: ${rvm_apt_binary} install curl g++ openjdk-6-jre-headless
jruby-head: ${rvm_apt_binary} install ant openjdk-6-jdk
# For IronRuby, install the following:
ironruby: ${rvm_apt_binary} install curl mono-2.0-devel
"
elif [[ -n "$rvm_emerge_binary" ]]
then
printf "%b" "
Additional Dependencies:
# For Ruby / Ruby HEAD (MRI, Rubinius, & REE), install the following:
ruby|ruby-head: emerge libiconv readline zlib openssl curl git libyaml sqlite libxslt libtool gcc autoconf automake bison m4
# For JRuby, install the following:
jruby: emerge dev-java/sun-jdk dev-java/sun-jre-bin
# For IronRuby, install the following:
ironruby: emerge dev-lang/mono
"
elif [[ -n "$rvm_pacman_binary" ]]
then
printf "%b" "
Additional Dependencies:
# For Ruby / Ruby HEAD (MRI, Rubinius, & REE), install the following:
ruby: pacman -Sy --noconfirm gcc patch curl zlib readline libxml2 libxslt git autoconf automake diffutils make libtool bison subversion
# For JRuby, install the following:
jruby: pacman -Sy --noconfirm jdk7-openjdk jre7-openjdk curl
jruby-head: pacman -Sy apache-ant
# For IronRuby, install the following:
ironruby: pacman -Sy --noconfirm mono
"
elif [[ -n "$rvm_yum_binary" ]]
then
printf "%b" "
Additional Dependencies:
# For Ruby / Ruby HEAD (MRI, Rubinius, & REE), install the following:
ruby: yum install -y gcc-c++ patch readline readline-devel zlib zlib-devel libyaml-devel libffi-devel openssl-devel make bzip2 autoconf automake libtool bison iconv-devel ## NOTE: For centos >= 5.4 iconv-devel is provided by glibc
# For JRuby, install the following:
jruby: yum install -y java
"
elif [[ -n "$rvm_zypper_binary" ]]
then
printf "%b" "
Additional Dependencies:
# For Ruby / Ruby HEAD (MRI, Rubinius, & REE), install the following:
ruby: sudo zypper install -y patterns-openSUSE-devel_basis gcc-c++ bzip2 readline-devel zlib-devel
libxml2-devel libxslt-devel libyaml-devel libopenssl-devel libffi45-devel
libtool bison
# For JRuby, install the following:
jruby: sudo zypper install -y java-1_6_0-sun # Non-Oss repository required
"
elif [[ -n "$rvm_pkg_add_binary" ]]
then
printf "%b" "
Additional dependencies:
# Ruby / Ruby HEAD (MRI, Rubinius, & REE)
#
# 'patch' and 'zlib' is already in base
#
ruby: pkg_add gcc curl readline libxml2 libxslt git autoconf automake diffutils make libtool bison subversion
# JRuby
#
jruby: pkg_add jdk curl
jruby-head: pkg_add apache-ant
# IronRuby
#
ironruby: pkg_add mono
"
else
printf "%b" "
Additional Dependencies:
# For Ruby / Ruby HEAD (MRI, Rubinius, & REE), install the following with development headers:
ruby: # gcc-c++ patch readline zlib libyaml iconv libxml2 libxslt libtool bison
# For JRuby, install the following:
jruby: # The SUN java runtime environment and development kit.
# For IronRuby, install the following:
ironruby: #The Mono Runtime and Development Platform (version 2.6 or greater is recommended).
"
fi
elif [[ "SunOS" == "$system" ]]
then
version="$(uname -v)"
if [[ "11.0" == "$version" ]]
then
# looks like Solaris 11
printf "%b" "
RVM requirements for Solaris 11:
# For Ruby / Ruby HEAD (MRI, Rubinius, & REE), install the following:
ruby: pkg install text/gnu-patch developer/gcc-45 developer/library/lint system/header \\
system/library/math/header-math file/gnu-coreutils
# For JRuby, install the following:
jruby: # The Oracle java runtime environment and development kit.
"
elif [[ "$version" =~ ^oi ]]
then
# looks like OpenIndiana
printf "%b" "
RVM requirements for OpenIndiana
# For Ruby / Ruby HEAD (MRI, Rubinius, & REE), install the following:
ruby: pkg install text/gnu-patch runtime/gcc developer/library/lint system/header \\
system/library/math/header-math file/gnu-coreutils
# For JRuby, install the following:
jruby: # The Oracle java runtime environment and development kit.
"
elif [[ "$version" =~ ^joyent ]]
then
# looks like SmartOS
printf "%b" "
RVM requirements for SmartOS
# For Ruby / Ruby HEAD (MRI, Rubinius, & REE), install the following:
ruby: sudo pkgin install coreutils patch gcc47 gmake readline curl scmgit-base sqlite3 \\
libxml2 libxslt ncurses
# For JRuby, install the following:
jruby: sudo pkgin install sun-jdk6
"
else
printf "%b" "
RVM requirements for unrecognised Solaris system.
# For Ruby / Ruby HEAD (MRI, Rubinius, & REE), install the following:
ruby: you will need to install: gcc, gnu-patch, lint library, system header, system
math header and gnu-coreutils.
Check you package publisher(s) for installing these.
# For JRuby, install the following:
jruby: # The Oracle java runtime environment and development kit.
"
fi
elif [[ "$MACHTYPE" == *darwin* ]]
then
if ! typeset -f __rvm_detect_xcode_version > /dev/null 2>&1
then source $rvm_path/scripts/functions/utility
fi
release="$( sw_vers -productName )"
version="$( sw_vers -productVersion )"
xcode_version="$( __rvm_detect_xcode_version 2>&1 )"
: ${xcode_version:=0}
printf "%b" "
Notes for ${release} ${version}"
if __rvm_version_compare "$xcode_version" -eq 0
then
printf "%b" ", No Xcode.
"
else
printf "%b" ", Xcode $xcode_version.
"
fi
if __rvm_version_compare "$xcode_version" -ge 4.2
then
printf "%b" "
For MacRuby: Install LLVM first.
"
fi
printf "%b" "
For JRuby: Install the JDK. See http://developer.apple.com/java/download/ # Current Java version \"1.6.0_26\"
For IronRuby: Install Mono >= 2.6
For Ruby 1.9.3: Install libksba # If using Homebrew, 'brew install libksba'
To use an RVM installed Ruby as default, instead of the system ruby:
rvm install 1.8.7 # installs patch 357: closest supported version
rvm system ; rvm gemset export system.gems ; rvm 1.8.7 ; rvm gemset import system.gems # migrate your gems
rvm alias create default 1.8.7
And reopen your terminal windows.
"
if __rvm_version_compare "$xcode_version" -gt 0 && __rvm_version_compare "$xcode_version" -lt 4.1
then
printf "%b" "
** Please note that Xcode 3.x will *not* work on OS X Lion. For notes about Xcode 4.1 and later, see below:
"
fi
printf "%b" "
${rvm_error_clr:-}Xcode and gcc${rvm_reset_clr:-}:
Right now Ruby requires gcc to compile, but Xcode 4.2 and later no longer ship with gcc. Instead they ship with llvm-gcc (to which gcc is a symlink) and clang, neither of which are supported for building Ruby. Xcode 4.1 was the last version to ship gcc, which was /usr/bin/gcc-4.2.
${rvm_notify_clr:-}Xcode 4.1${rvm_reset_clr:-} and earlier:
- Ruby will build fine.
${rvm_error_clr:-}Xcode 4.2${rvm_reset_clr:-} and later (including Command Line Tools for Xcode):
- If you have gcc-4.2 (and friends) from an earlier Xcode version, Ruby will build fine.
- If you don't have gcc-4.2, you have two options to get it:
* Install apple-gcc42 from Homebrew
* Install osx-gcc-installer
${rvm_notify_clr:-}Homebrew${rvm_reset_clr:-}:
If you are using Homebrew, you can install the apple-gcc42 and required libraries from homebrew/dupes:
brew update
brew tap homebrew/dupes
brew install autoconf automake apple-gcc42
rvm pkg install openssl
Xcode 4.2+ install or/and Command Line Tools for Xcode is required to provide make and other tools.
${rvm_notify_clr:-}osx-gcc-installer${rvm_reset_clr:-}:
If you don't use Homebrew, you can download and install osx-gcc-installer: https://github.com/kennethreitz/osx-gcc-installer.
${rvm_error_clr:-}Warning${rvm_reset_clr:-}: Installing osx-gcc-installer on top of a recent Xcode is known to cause problems, so you must uninstall Xcode before installing osx-gcc-installer. Afterwards you may install Xcode 4.2+ or Command Line Tools for Xcode if you desire.
** NOTE: Currently, Node.js is having issues building with osx-gcc-installer. The only fix is to install Xcode over osx-gcc-installer.
"
if (( UID == 0 )) || [[ "$rvm_path" == "/usr/local/rvm" ]]
then
printf "%b" "
${rvm_notify_clr:-}RVM Group Membership Management${rvm_reset_clr:-} - With Multi-User installations, the RVM installer automatically
creates an 'rvm' group which, as the RVM documentation explains, administrators must add the users they wish
to let use the RVM installation to. The call is made in the installer as:
${rvm_notify_clr:-}sudo dscl . -create /Groups/\$rvm_group_name gid \$gid${rvm_reset_clr:-}
wherein RVM creates the gid by checking for the last assigned gid and adding 1. To physicially add a user to
the group, administrators must use:
${rvm_notify_clr:-}sudo dscl localhost -append /Local/Default/Groups/rvm GroupMembership \$user_name${rvm_notify_clr:-}
To check on group membership to the RVM group, administrators would execute the following:
${rvm_notify_clr:-}rvmsudo dscl localhost -read /Local/Default/Groups/rvm${rvm_reset_clr:-}
Pay attention to the GroupMembership and PrimaryGroupID lines. This tells you who is in it, and the GID for the RVM group.
Afterwards, should administrators wish to remove users from the group, they would execute:
${rvm_notify_clr:-}sudo dscl localhost -delete /Local/Default/Groups/rvm GroupMembership \$user_name${rvm_reset_clr:-}
${rvm_notify_clr:-}sudo dsmemberutil flushcache${rvm_reset_clr:-}
This will keep the 'rvm' group, but remove the listed user from it. They can directly delete the rvm group with:
${rvm_notify_clr:-}sudo dscl . -delete /Groups/rvm && sudo dsmemberutil flushcache${rvm_reset_clr:-}
without previously deleting users from the group, as well. This will completely remove the 'rvm' group from the system.
Please note, the call to 'dsmemberutil flushcache' is required on both removal of the user from the group, and/or
removal of the group directly because that membership is still cached locally until either reboot or sync with
Directory Services. Allowing the group membership to stay in the user's 'groups' output does not mean the user is
automatically re-added to the 'rvm' group should the group be subsequently be re-added. This means the user(s) end up
erroneously showing they are part of the 'rvm' group even though they actually are not, if the call to 'dsmemberutil'
is not made. By this we mean the 'groups' command will still show them a part of the 'rvm' group, even if the user
logs out and then back in, due to caching. This applies to Tiger, Leopard, Snow Leopard, and Lion. Previous versions of
the OS such as Cheetah/Puma, and Jaguar used 'nicl', a.k.a NetInfo, and not 'dscl'.
"
fi
fi
printf "%b" "\n"
) # Finish color resetting block