File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55
66set -euo pipefail
77
8- VERSION=" 3.2.8 "
9- SHA256=" 77acdd8cfbbe1f8e573b5e6536e03c5103df989dc05fa68c70f011833c356075 "
8+ VERSION=" 3.2.9 "
9+ SHA256=" abbad98db9aeb152773b0d35868e50003b8c467f3d06152577c4dfed9d88ed2a "
1010
1111[ " ${1:- } " = " --force" ] && FORCE=1 || FORCE=" "
1212
13- [ $UID -eq 0 ] || { echo " Root required" ; exit 1; }
13+ [ $UID -eq 0 ] || {
14+ echo " Root required"
15+ exit 1
16+ }
1417
1518# Install Ruby and Bundler if they are missing or the force flag is set
16- if [ -n " $FORCE " ] || ! command -v ruby > /dev/null; then
19+ if [ -n " $FORCE " ] || ! command -v ruby > /dev/null; then
1720 # Dependency list:
1821 # - wget: to fetch Ruby and pretty useful anyway
1922 # - gcc & make: to compile Ruby
Original file line number Diff line number Diff line change 55
66set -euo pipefail
77
8- VERSION=" 3.3.8 "
9- SHA256=" 5ae28a87a59a3e4ad66bc2931d232dbab953d0aa8f6baf3bc4f8f80977c89cab "
8+ VERSION=" 3.3.10 "
9+ SHA256=" b555baa467a306cfc8e6c6ed24d0d27b27e9a1bed1d91d95509859eac6b0e928 "
1010
1111[ " ${1:- } " = " --force" ] && FORCE=1 || FORCE=" "
1212
13- [ $UID -eq 0 ] || { echo " Root required" ; exit 1; }
13+ [ $UID -eq 0 ] || {
14+ echo " Root required"
15+ exit 1
16+ }
1417
1518# Install Ruby and Bundler if they are missing or the force flag is set
16- if [ -n " $FORCE " ] || ! command -v ruby > /dev/null; then
19+ if [ -n " $FORCE " ] || ! command -v ruby > /dev/null; then
1720 # Dependency list:
1821 # - wget: to fetch Ruby and pretty useful anyway
1922 # - gcc & make: to compile Ruby
Original file line number Diff line number Diff line change 55
66set -euo pipefail
77
8- VERSION=" 3.4.4 "
9- SHA256=" a0597bfdf312e010efd1effaa8d7f1d7833146fdc17950caa8158ffa3dcbfa85 "
8+ VERSION=" 3.4.8 "
9+ SHA256=" 53c4ddad41fbb6189f1f5ee0db57a51d54bd1f87f8755b3d68604156a35b045b "
1010
1111[ " ${1:- } " = " --force" ] && FORCE=1 || FORCE=" "
1212
13- [ $UID -eq 0 ] || { echo " Root required" ; exit 1; }
13+ [ $UID -eq 0 ] || {
14+ echo " Root required"
15+ exit 1
16+ }
1417
1518# Install Ruby and Bundler if they are missing or the force flag is set
16- if [ -n " $FORCE " ] || ! command -v ruby > /dev/null; then
19+ if [ -n " $FORCE " ] || ! command -v ruby > /dev/null; then
1720 # Dependency list:
1821 # - wget: to fetch Ruby and pretty useful anyway
1922 # - gcc & make: to compile Ruby
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ # Download, configure and install Ruby and Bundler
4+ # https://github.com/infertux/ruby-bootstrap
5+
6+ set -euo pipefail
7+
8+ VERSION=" 4.0.0"
9+ SHA256=" 2e8389c8c072cb658c93a1372732d9eac84082c88b065750db1e52a5ac630271"
10+
11+ [ " ${1:- } " = " --force" ] && FORCE=1 || FORCE=" "
12+
13+ [ $UID -eq 0 ] || {
14+ echo " Root required"
15+ exit 1
16+ }
17+
18+ # Install Ruby and Bundler if they are missing or the force flag is set
19+ if [ -n " $FORCE " ] || ! command -v ruby > /dev/null; then
20+ # Dependency list:
21+ # - wget: to fetch Ruby and pretty useful anyway
22+ # - gcc & make: to compile Ruby
23+ # - various libs: libraries for Ruby
24+
25+ if [ -f /etc/debian_version ]; then
26+ apt-get update
27+ apt-get install -y wget gcc make libffi-dev libreadline-dev libssl-dev libyaml-dev zlib1g-dev
28+ elif [ -f /etc/redhat-release ]; then
29+ yum install -y wget gcc make openssl-devel readline-devel zlib-devel
30+ fi
31+
32+ cd /tmp
33+ wget https://cache.ruby-lang.org/pub/ruby/${VERSION% .* } /ruby-${VERSION} .tar.gz
34+ echo " ${SHA256} ruby-${VERSION} .tar.gz" | sha256sum -c -
35+ tar --no-same-owner -xf ruby-${VERSION} .tar.gz
36+
37+ pushd ruby-${VERSION}
38+ ./configure --disable-install-doc
39+ cpus=$( grep -c processor /proc/cpuinfo)
40+ make -j " $cpus "
41+ make install
42+ popd
43+
44+ rm -rf ruby-${VERSION} .tar.gz ruby-${VERSION}
45+
46+ ln -sfv /usr/local/bin/ruby /bin/ruby
47+ ln -sfv /usr/local/bin/gem /bin/gem
48+ ln -sfv /usr/local/bin/bundle /bin/bundle
49+
50+ ruby -v
51+ gem -v
52+ bundle -v
53+ fi
54+
55+ echo " All good to go, happy Rubying!"
Original file line number Diff line number Diff line change 55
66set -euo pipefail
77
8- VERSION=" 3.4.4 "
9- SHA256=" a0597bfdf312e010efd1effaa8d7f1d7833146fdc17950caa8158ffa3dcbfa85 "
8+ VERSION=" 4.0.0 "
9+ SHA256=" 2e8389c8c072cb658c93a1372732d9eac84082c88b065750db1e52a5ac630271 "
1010
1111[ " ${1:- } " = " --force" ] && FORCE=1 || FORCE=" "
1212
13- [ $UID -eq 0 ] || { echo " Root required" ; exit 1; }
13+ [ $UID -eq 0 ] || {
14+ echo " Root required"
15+ exit 1
16+ }
1417
1518# Install Ruby and Bundler if they are missing or the force flag is set
16- if [ -n " $FORCE " ] || ! command -v ruby > /dev/null; then
19+ if [ -n " $FORCE " ] || ! command -v ruby > /dev/null; then
1720 # Dependency list:
1821 # - wget: to fetch Ruby and pretty useful anyway
1922 # - gcc & make: to compile Ruby
You can’t perform that action at this time.
0 commit comments