Skip to content

Instantly share code, notes, and snippets.

@bestie
Last active November 14, 2024 17:39
Show Gist options
  • Save bestie/dc71d29afa2591c5c0e42a3bf6554d5a to your computer and use it in GitHub Desktop.
Save bestie/dc71d29afa2591c5c0e42a3bf6554d5a to your computer and use it in GitHub Desktop.
Bash script to build Ruby from source, extracted from build instructions in the repo
#!/usr/bin/env bash
set -e
./configure --with-opt-dir=$(brew --prefix gmp):$(brew --prefix jemalloc)
export CONFIGURE_ARGS=""
for ext in openssl readline libyaml zlib; do
CONFIGURE_ARGS="${CONFIGURE_ARGS} --with-$ext-dir=$(brew --prefix $ext)"
done
./autogen.sh
mkdir -p build && cd build
mkdir -p ~/.rubies/master
../configure --config-cache --prefix="${HOME}/.rubies/ruby-master"
make && make install
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment