Ruby-4.0.3

#### Beyond Linux® From Scratch (System V Edition) - Version r13.0-584

### Chapter 13. Programming

- Prev

  Python Dependencies

- Next

  Rustc-1.95.0

- Up
- Home

# Ruby-4.0.3

## Introduction to Ruby

The Ruby package contains the Ruby development environment. This is useful for object-oriented scripting.

### Note

Development versions of BLFS may not build or run some packages properly if LFS or dependencies have been updated since the most recent stable versions of the books.

### Package Information

- Download (HTTP): https://cache.ruby-lang.org/pub/ruby/4.0/ruby-4.0.3.tar.xz

- Download MD5 sum: e182f8c1c1a5c2804b2783439a5ee1cc

- Download size: 18 MB

- Estimated disk space required: 2.8 GB (with C API docs and tests)

- Estimated build time: 1.5 SBU (with C API docs; using parallelism=4; add 0.4 SBU for tests)

### Ruby Dependencies

#### Required

libyaml-0.2.5

#### Optional

Doxygen-1.17.0, Graphviz-14.1.5, rustc-1.95.0, Tk-8.6.18, Valgrind-3.27.0, Berkeley DB (deprecated) and DTrace

### Note

An Internet connection is needed for some tests of this package. The system certificate store may need to be set up with make-ca-1.16.1 before testing this package.

## Installation of Ruby

### Note

If you have installed a package that provides a ruby gem, such as asciidoctor-2.0.26, you must reinstall those packages when upgrading to a new minor version of Ruby.

Install Ruby by running the following command:

    ./configure --prefix=/usr         \
                --disable-rpath       \
                --enable-shared       \
                --without-valgrind    \
                --without-baseruby    \
                ac_cv_func_qsort_r=no \
                --docdir=/usr/share/doc/ruby-4.0.3 &&
    make

Optionally, build the CAPI documents by running the following commands:

    make capi

To test the results, issue: make -k check. If the environment has variables related to proxy settings (`all_proxy`, `ALL_PROXY`, `http_proxy`, and etc.) set, the test suite will bail out early with messages like `net/ftp is not found`. Make sure that you unset these variables for the test suite.

Now, as the `root` user:

    XDG_DATA_HOME=/tmp make install

### Note

If you have Ruby-On-Rails applications installed and did an upgrade of Ruby by installing this package, you might need to run an update there, too (as the `root` user):

    cd /path/to/web/app
    bundle update rake

and restart the webserver which serves the application.

## Command Explanations

`--disable-rpath`: This switch disables embedding `/usr/lib` as a library search path into the ruby program. Doing so is not needed (because `/usr/lib` is a system library path) and it may cause the test suite running with the system `libruby.so` instead of the just built one when Ruby has been installed.

`--enable-shared`: This switch enables building the `libruby` shared library.

`--without-baseruby`: This switch prevents using the system ruby if it is already installed. The build system will use the newly built version instead.

`ac_cv_func_qsort_r=no`: This switch prevents using the `qsort_r` function from Glibc. Ruby makes some aggressive optimization assuming some implementation details of the sorting algorithm, but the assumption is not true with the Glibc implementation. With this switch Ruby will use its own sort implementation instead.

`--disable-install-doc`: This switch disables building and installing rdoc indexes and C API documents.

`--disable-install-rdoc`: This switch disables building and installing rdoc indexes.

`--disable-install-capi`: This switch disables building and installing C API documents.

XDG_DATA_HOME=/tmp ...: If `XDG_DATA_HOME` is not set, the installation process creates the `$HOME/.local/share` directory if it does not exist. Depending on the way root privileges have been acquired, this may create files owned by `root` in the user home directory, or in `/root`, which is not desirable either.

## Contents

Installed Programs: bundle, bundler, erb, gem, irb, racc, rake, rbs, rdbg, rdoc, ri, ruby, and typeprof
Installed Libraries: libruby.so
Installed Directories: /usr/include/ruby-4.0.0, /usr/lib/ruby, /usr/share/doc/ruby-4.0.3 and /usr/share/ri

### Short Descriptions

bundle | creates bundles of Ruby Gems
bundler | manages an application's dependencies throughout its lifecycle
erb | is a command line front-end for eRuby, which provides a templating system for Ruby
gem | is the command for RubyGems, which is a sophisticated package manager for Ruby. This is similar to Python's 'pip' command
irb | is the interactive interface for Ruby
rake | is a make-like build utility for Ruby
rdbg | is an interactive debugger for Ruby
rdoc | generates Ruby documentation
ri | displays documentation from a database on Ruby classes, modules, and methods
ruby | is an interpreted scripting language for quick and easy object-oriented programming
`libruby.so` | contains the API functions required by Ruby

- Prev

  Python Dependencies

- Next

  Rustc-1.95.0

- Up
- Home