Ruby Hacking Guide ↑

This document gives some helpful instructions which should make your experience as a Ruby core developer easier.

Setup ↑

Make ↑

It’s common to want to compile things as quickly as possible. Ensuring make has the right --jobs flag will ensure all processors are utilized when building software projects. To do this effectively, you can set MAKEFLAGS in your shell configuration/profile:

# On macOS with Fish shell:
export MAKEFLAGS="--jobs "(sysctl -n hw.ncpu)

# On macOS with Bash/ZSH shell:
export MAKEFLAGS="--jobs $(sysctl -n hw.ncpu)"

# On Linux with Fish shell:
export MAKEFLAGS="--jobs "(nproc)

# On Linux with Bash/ZSH shell:
export MAKEFLAGS="--jobs $(nproc)"

Configure Ruby ↑

It’s generally advisable to use a build directory.

./autogen.sh
mkdir build
cd build
../configure --prefix $HOME/.rubies/ruby-head
make install

Without Documentation ↑

If you are frequently building Ruby, this will reduce the time it takes to make install.

../configure --disable-install-doc

Running Ruby