DEV Community

kojix2
kojix2

Posted on

Fast multi-core installation of Ruby gems with C extensions

It's easy. Simply set the environment variable GNUMAKEFLAGS or MAKEFLAGS.

export GNUMAKEFLAGS=-j4
Enter fullscreen mode Exit fullscreen mode

Update locally installed gems.

MAKEFLAGS=-j8 gem update
Enter fullscreen mode Exit fullscreen mode

This technique can be applied to programming languages other than Ruby. For example, the R language library also uses the C++ extension, and these environment variables will speed up the installation.

Have a nice day!

Top comments (0)