glfs/general/prog/ruby.xml

381 lines
11 KiB
XML
Raw Normal View History

2024-01-20 05:35:53 +08:00
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
<!ENTITY % general-entities SYSTEM "../../general.ent">
%general-entities;
<!ENTITY ruby-download-http "https://cache.ruby-lang.org/pub/ruby/&ruby-minor-version;/ruby-&ruby-version;.tar.xz">
<!ENTITY ruby-download-ftp " ">
2023-12-28 03:34:15 +08:00
<!ENTITY ruby-md5sum "b5e59d56faf25b1ec6445abdf203affa">
<!ENTITY ruby-size "16 MB">
<!ENTITY ruby-buildsize "774 MB (with tests and C API docs)">
<!ENTITY ruby-time "3.4 SBU (using parallelism=4; with tests and C API docs)">
]>
<sect1 id="ruby" xreflabel="Ruby-&ruby-version;">
<?dbhtml filename="ruby.html"?>
<title>Ruby-&ruby-version;</title>
<indexterm zone="ruby">
<primary sortas="a-Ruby">Ruby</primary>
</indexterm>
<sect2 role="package">
<title>Introduction to Ruby</title>
<para>
The <application>Ruby</application> package contains the
<application>Ruby</application> development environment. This
is useful for object-oriented scripting.
</para>
2023-08-17 08:32:11 +08:00
&lfs120_checked;
<bridgehead renderas="sect3">Package Information</bridgehead>
<itemizedlist spacing="compact">
<listitem>
<para>
Download (HTTP): <ulink url="&ruby-download-http;"/>
</para>
</listitem>
<listitem>
<para>
Download (FTP): <ulink url="&ruby-download-ftp;"/>
</para>
</listitem>
<listitem>
<para>
Download MD5 sum: &ruby-md5sum;
</para>
</listitem>
<listitem>
<para>
Download size: &ruby-size;
</para>
</listitem>
<listitem>
<para>
Estimated disk space required: &ruby-buildsize;
</para>
</listitem>
<listitem>
<para>
Estimated build time: &ruby-time;
</para>
</listitem>
</itemizedlist>
<bridgehead renderas="sect3">Ruby Dependencies</bridgehead>
2023-01-30 10:05:42 +08:00
<bridgehead renderas="sect4">Required</bridgehead>
<para role="required">
<xref linkend="libyaml"/>
</para>
<bridgehead renderas="sect4">Optional</bridgehead>
<para role="optional">
<xref linkend="doxygen"/>,
<xref linkend="graphviz"/>,
<xref linkend="rust"/>,
<xref linkend="tk"/>,
2023-11-23 05:35:10 +08:00
<xref linkend="valgrind"/>,
&berkeley-db; and
<ulink url="http://dtrace.org/blogs/about/">DTrace</ulink>
</para>
</sect2>
<sect2 role="installation">
<title>Installation of Ruby</title>
<para>
Install <application>Ruby</application> by running the following
command:
</para>
2023-02-15 04:32:46 +08:00
<screen><userinput>./configure --prefix=/usr \
2024-01-22 21:33:50 +08:00
--disable-rpath \
2023-02-15 04:32:46 +08:00
--enable-shared \
--without-valgrind \
2023-04-07 08:27:45 +08:00
--without-baseruby \
--docdir=/usr/share/doc/ruby-&ruby-version; &amp;&amp;
make</userinput></screen>
<para>
Optionally, build the CAPI documents by running the following
commands:
</para>
<screen><userinput>make capi</userinput></screen>
<para>
2024-01-23 04:19:28 +08:00
To test the results, issue: <command>make -j1 -k check</command>.
Note that running the test suite with parallel jobs may cause test
failures outputted as cryptic <computeroutput>unknown
object</computeroutput> messages, resulting a summary falsely claiming
<quote>all tests passed</quote>. If the environment has variables
related to proxy settings (<envar>all_proxy</envar>,
<envar>ALL_PROXY</envar>, <envar>http_proxy</envar>, and etc.) set,
the test suite will bail out early with messages like
<computeroutput>net/ftp is not found</computeroutput>. So make sure
unsetting them for the test suite. There are over 26,000 tests.
<!-- https://bugs.ruby-lang.org/issues/20106 -->
12 tests are known to fail because of expired certificates in the
test data. Some tests related to ipv6 may indicate errors. If the
tests are run in a directory that has a world writable component (e.g.
2024-01-23 04:19:28 +08:00
/tmp) then several additional tests may fail.
</para>
2023-04-07 08:27:45 +08:00
2023-12-28 03:34:15 +08:00
<para>
Now, as the <systemitem class="username">root</systemitem> user:
</para>
<screen role="root"><userinput>make install</userinput></screen>
2022-11-28 19:27:11 +08:00
<note>
<para>
If you have Ruby-On-Rails applications installed and did an
upgrade of <application>Ruby</application> by installing this
2022-11-30 21:50:05 +08:00
package, you might need to run an update there, too
(as the &root; user):
2022-11-28 19:27:11 +08:00
</para>
2022-11-30 21:50:05 +08:00
<screen role="nodump"><userinput>cd /path/to/web/app
bundle update rake</userinput></screen>
<para>
and restart the webserver which serves the application.
</para>
2022-11-28 19:27:11 +08:00
</note>
</sect2>
<sect2 role="commands">
<title>Command Explanations</title>
2024-01-22 21:33:50 +08:00
<para>
<parameter>--disable-rpath</parameter>: This switch disables embedding
<filename class='directory'>/usr/lib</filename> as a library search
path into the <command>ruby</command> program. Doing so is not needed
(because <filename class='directory'>/usr/lib</filename> is a system
library path) and it may cause the test suite running with the system
<filename class='libraryfile'>libruby.so</filename> instead of the
just built one when Ruby has been installed.
</para>
<para>
<parameter>--enable-shared</parameter>: This switch enables building
the <filename class="libraryfile">libruby</filename> shared library.
</para>
2023-04-07 08:27:45 +08:00
<para>
<parameter>--without-baseruby</parameter>: This switch prevents using the
system <command>ruby</command> if it is already installed. The build
system will use the newly built version instead.
</para>
<para>
<option>--disable-install-doc</option>: This switch disables building and
installing rdoc indexes and C API documents.
</para>
<para>
<option>--disable-install-rdoc</option>: This switch disables building
and installing rdoc indexes.
</para>
<para>
<option>--disable-install-capi</option>: This switch disables building
and installing C API documents.
</para>
</sect2>
<sect2 role="content">
<title>Contents</title>
<segmentedlist>
<segtitle>Installed Programs</segtitle>
<segtitle>Installed Libraries</segtitle>
<segtitle>Installed Directories</segtitle>
<seglistitem>
<seg>
bundle,
bundler,
erb,
gem,
irb,
racc,
rake,
rbs,
rdbg,
rdoc,
ri,
ruby, and
typeprof
</seg>
<seg>
libruby.so
</seg>
<seg>
/usr/include/ruby-&ruby-minor-version;.0,
/usr/lib/ruby,
/usr/share/doc/ruby-&ruby-version; and
/usr/share/ri
</seg>
</seglistitem>
</segmentedlist>
<variablelist>
<bridgehead renderas="sect3">Short Descriptions</bridgehead>
<?dbfo list-presentation="list"?>
<?dbhtml list-presentation="table"?>
<varlistentry id="bundle">
<term><command>bundle</command></term>
<listitem>
<para>
creates bundles of Ruby Gems
</para>
<indexterm zone="ruby bundle">
<primary sortas="b-bundle">bundle</primary>
</indexterm>
</listitem>
</varlistentry>
<varlistentry id="bundler">
<term><command>bundler</command></term>
<listitem>
<para>
manages an application's dependencies throughout it's lifecycle
</para>
<indexterm zone="ruby bundler">
<primary sortas="b-bundler">bundler</primary>
</indexterm>
</listitem>
</varlistentry>
<varlistentry id="erb">
<term><command>erb</command></term>
<listitem>
<para>
is a command line front-end for eRuby, which provides a templating
system for <application>Ruby</application>
</para>
<indexterm zone="ruby erb">
<primary sortas="b-erb">erb</primary>
</indexterm>
</listitem>
</varlistentry>
<varlistentry id="gem">
<term><command>gem</command></term>
<listitem>
<para>
is the command for RubyGems, which is a sophisticated package
manager for <application>Ruby</application>. This is similar
to Python's 'pip' command
</para>
<indexterm zone="ruby gem">
<primary sortas="b-gem">gem</primary>
</indexterm>
</listitem>
</varlistentry>
<varlistentry id="irb">
<term><command>irb</command></term>
<listitem>
<para>
is the interactive interface for
<application>Ruby</application>
</para>
<indexterm zone="ruby irb">
<primary sortas="b-irb">irb</primary>
</indexterm>
</listitem>
</varlistentry>
<varlistentry id="rake">
<term><command>rake</command></term>
<listitem>
<para>
is a make-like build utility for <application>Ruby</application>
</para>
<indexterm zone="ruby rake">
<primary sortas="b-rake">rake</primary>
</indexterm>
</listitem>
</varlistentry>
<varlistentry id="rdbg">
<term><command>rdbg</command></term>
<listitem>
<para>
is an interactive debugger for <application>Ruby</application>
</para>
<indexterm zone="ruby rdbg">
<primary sortas="b-rdbg">rdbg</primary>
</indexterm>
</listitem>
</varlistentry>
<varlistentry id="rdoc">
<term><command>rdoc</command></term>
<listitem>
<para>
generates <application>Ruby</application> documentation
</para>
<indexterm zone="ruby rdoc">
<primary sortas="b-rdoc">rdoc</primary>
</indexterm>
</listitem>
</varlistentry>
<varlistentry id="ri">
<term><command>ri</command></term>
<listitem>
<para>
displays documentation from a database on
<application>Ruby</application> classes, modules, and methods
</para>
<indexterm zone="ruby ri">
<primary sortas="b-ri">ri</primary>
</indexterm>
</listitem>
</varlistentry>
<varlistentry id="ruby-prog">
<term><command>ruby</command></term>
<listitem>
<para>
is an interpreted scripting language for quick
and easy object-oriented programming
</para>
<indexterm zone="ruby ruby-prog">
<primary sortas="b-ruby">ruby</primary>
</indexterm>
</listitem>
</varlistentry>
<varlistentry id="libruby">
<term><filename role="libraryfile">libruby.so</filename></term>
<listitem>
<para>
contains the API functions required by <application>Ruby</application>
</para>
<indexterm zone="ruby libruby">
<primary sortas="c-libruby">libruby.so</primary>
</indexterm>
</listitem>
</varlistentry>
</variablelist>
</sect2>
</sect1>