Skip to content

Commit 088a819

Browse files
committed
Add script for Ruby 3.4
1 parent 2458cfd commit 088a819

File tree

6 files changed

+60
-8
lines changed

6 files changed

+60
-8
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
strategy:
1717
fail-fast: false
1818
matrix:
19-
script: [ "3.2", "3.3", "stable" ]
19+
script: [ "3.2", "3.3", "3.4", "stable" ]
2020
platform: [ "debian", "ubuntu" ]
2121
steps:
2222
- uses: actions/checkout@v3

LICENSE.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2015-2024 Cédric Félizard
3+
Copyright (c) 2015-2025 Cédric Félizard
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

bootstrap_ruby_3.2.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55

66
set -euo pipefail
77

8-
VERSION="3.2.4"
9-
SHA256="c72b3c5c30482dca18b0f868c9075f3f47d8168eaf626d4e682ce5b59c858692"
8+
VERSION="3.2.7"
9+
SHA256="8488fa620ff0333c16d437f2b890bba3b67f8745fdecb1472568a6114aad9741"
1010

1111
[ "${1:-}" = "--force" ] && FORCE=1 || FORCE=""
1212

bootstrap_ruby_3.3.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55

66
set -euo pipefail
77

8-
VERSION="3.3.4"
9-
SHA256="fe6a30f97d54e029768f2ddf4923699c416cdbc3a6e96db3e2d5716c7db96a34"
8+
VERSION="3.3.7"
9+
SHA256="9c37c3b12288c7aec20ca121ce76845be5bb5d77662a24919651aaf1d12c8628"
1010

1111
[ "${1:-}" = "--force" ] && FORCE=1 || FORCE=""
1212

bootstrap_ruby_3.4.sh

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
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="3.4.2"
9+
SHA256="41328ac21f2bfdd7de6b3565ef4f0dd7543354d37e96f157a1552a6bd0eb364b"
10+
11+
[ "${1:-}" = "--force" ] && FORCE=1 || FORCE=""
12+
13+
[ $UID -eq 0 ] || { echo "Root required"; exit 1; }
14+
15+
# Install Ruby and Bundler if they are missing or the force flag is set
16+
if [ -n "$FORCE" ] || ! command -v ruby > /dev/null; then
17+
# Dependency list:
18+
# - wget: to fetch Ruby and pretty useful anyway
19+
# - gcc & make: to compile Ruby
20+
# - various libs: libraries for Ruby
21+
22+
if [ -f /etc/debian_version ]; then
23+
apt-get update
24+
apt-get install -y wget gcc make libffi-dev libreadline-dev libssl-dev libyaml-dev zlib1g-dev
25+
elif [ -f /etc/redhat-release ]; then
26+
yum install -y wget gcc make openssl-devel readline-devel zlib-devel
27+
fi
28+
29+
cd /tmp
30+
wget https://cache.ruby-lang.org/pub/ruby/${VERSION%.*}/ruby-${VERSION}.tar.gz
31+
echo "${SHA256} ruby-${VERSION}.tar.gz" | sha256sum -c -
32+
tar --no-same-owner -xf ruby-${VERSION}.tar.gz
33+
34+
pushd ruby-${VERSION}
35+
./configure --disable-install-doc
36+
cpus=$(grep -c processor /proc/cpuinfo)
37+
make -j "$cpus"
38+
make install
39+
popd
40+
41+
rm -rf ruby-${VERSION}.tar.gz ruby-${VERSION}
42+
43+
ln -sfv /usr/local/bin/ruby /bin/ruby
44+
ln -sfv /usr/local/bin/gem /bin/gem
45+
ln -sfv /usr/local/bin/bundle /bin/bundle
46+
47+
ruby -v
48+
gem -v
49+
bundle -v
50+
fi
51+
52+
echo "All good to go, happy Rubying!"

bootstrap_ruby_stable.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55

66
set -euo pipefail
77

8-
VERSION="3.3.4"
9-
SHA256="fe6a30f97d54e029768f2ddf4923699c416cdbc3a6e96db3e2d5716c7db96a34"
8+
VERSION="3.4.2"
9+
SHA256="41328ac21f2bfdd7de6b3565ef4f0dd7543354d37e96f157a1552a6bd0eb364b"
1010

1111
[ "${1:-}" = "--force" ] && FORCE=1 || FORCE=""
1212

0 commit comments

Comments
 (0)