https://github.com/ruby/ruby/blob/master/doc/contributing/building_ruby.md
build
Dependencies
Install the prerequisite dependencies for building the CRuby interpreter:
- C compiler
For RubyGems, you will also need:
- OpenSSL 1.1.x or 3.0.x / LibreSSL
- libyaml 0.1.7 or later
- zlib
If you want to build from the git repository, you will also need:
- autoconf - 2.67 or later
- bison - 3.0 or later
- gperf - 3.1 or later
- Usually unneeded; only if you edit some source files using gperf
- ruby - 2.2 or later
- We can upgrade this version to system ruby version of the latest Ubuntu LTS.
Install optional, recommended dependencies:
- readline/editline (libedit, to build readline)
- libffi (to build fiddle)
- gmp (if you with to accelerate Bignum operations)
- libexecinfo (FreeBSD)
- rustc - 1.58.0 or later (if you wish to build YJIT)
If you installed the libraries needed for extensions (openssl, readline, libyaml, zlib) into other than the OS default place, typically using Homebrew on macOS, add
--with-EXTLIB-dir
options toCONFIGURE_ARGS
environment variable.1
2
3
4export CONFIGURE_ARGS=""
for ext in openssl readline libyaml zlib; do
CONFIGURE_ARGS="${CONFIGURE_ARGS} --with-$ext-dir=$(brew --prefix $ext)"
done
1 | $ ./configure --prefix=/opt/ruby --disable-install-doc |
源
1 | gem sources |
sudo gem install nokogiri