[ab4fdfc] | 1 | <?xml version="1.0" encoding="UTF-8"?>
|
---|
[6732c094] | 2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
---|
| 3 | "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
---|
[52d29f7] | 4 | <!ENTITY % general-entities SYSTEM "../../general.ent">
|
---|
| 5 | %general-entities;
|
---|
[cc13920] | 6 |
|
---|
[c6b192c] | 7 | <!ENTITY ruby-download-http "https://cache.ruby-lang.org/pub/ruby/&ruby-minor-version;/ruby-&ruby-version;.tar.xz">
|
---|
[2f3226d] | 8 | <!ENTITY ruby-download-ftp " ">
|
---|
[32f27dc7] | 9 | <!ENTITY ruby-md5sum "e696a878d05867a4d28e62fe9afb7862">
|
---|
[c4f5f1e] | 10 | <!ENTITY ruby-size "16 MB">
|
---|
[5cdaaee] | 11 | <!ENTITY ruby-buildsize "1.4 GB (with C API docs and tests)">
|
---|
| 12 | <!ENTITY ruby-time "2.4 SBU (using parallelism=4; with C API docs; add 0.4 SBU for tests)">
|
---|
[52d29f7] | 13 | ]>
|
---|
| 14 |
|
---|
[5db3785e] | 15 | <sect1 id="ruby" xreflabel="Ruby-&ruby-version;">
|
---|
[16f3afb3] | 16 | <?dbhtml filename="ruby.html"?>
|
---|
| 17 |
|
---|
| 18 |
|
---|
| 19 | <title>Ruby-&ruby-version;</title>
|
---|
| 20 |
|
---|
| 21 | <indexterm zone="ruby">
|
---|
| 22 | <primary sortas="a-Ruby">Ruby</primary>
|
---|
| 23 | </indexterm>
|
---|
| 24 |
|
---|
| 25 | <sect2 role="package">
|
---|
| 26 | <title>Introduction to Ruby</title>
|
---|
| 27 |
|
---|
[cc13920] | 28 | <para>
|
---|
| 29 | The <application>Ruby</application> package contains the
|
---|
| 30 | <application>Ruby</application> development environment. This
|
---|
| 31 | is useful for object-oriented scripting.
|
---|
| 32 | </para>
|
---|
[16f3afb3] | 33 |
|
---|
[5d0e7b8] | 34 | &lfs121_checked;
|
---|
[a1813d08] | 35 |
|
---|
[16f3afb3] | 36 | <bridgehead renderas="sect3">Package Information</bridgehead>
|
---|
| 37 | <itemizedlist spacing="compact">
|
---|
| 38 | <listitem>
|
---|
[cc13920] | 39 | <para>
|
---|
| 40 | Download (HTTP): <ulink url="&ruby-download-http;"/>
|
---|
| 41 | </para>
|
---|
[16f3afb3] | 42 | </listitem>
|
---|
| 43 | <listitem>
|
---|
[cc13920] | 44 | <para>
|
---|
| 45 | Download (FTP): <ulink url="&ruby-download-ftp;"/>
|
---|
| 46 | </para>
|
---|
[16f3afb3] | 47 | </listitem>
|
---|
| 48 | <listitem>
|
---|
[cc13920] | 49 | <para>
|
---|
| 50 | Download MD5 sum: &ruby-md5sum;
|
---|
| 51 | </para>
|
---|
[16f3afb3] | 52 | </listitem>
|
---|
| 53 | <listitem>
|
---|
[cc13920] | 54 | <para>
|
---|
| 55 | Download size: &ruby-size;
|
---|
| 56 | </para>
|
---|
[16f3afb3] | 57 | </listitem>
|
---|
| 58 | <listitem>
|
---|
[cc13920] | 59 | <para>
|
---|
| 60 | Estimated disk space required: &ruby-buildsize;
|
---|
| 61 | </para>
|
---|
[16f3afb3] | 62 | </listitem>
|
---|
| 63 | <listitem>
|
---|
[cc13920] | 64 | <para>
|
---|
| 65 | Estimated build time: &ruby-time;
|
---|
| 66 | </para>
|
---|
[16f3afb3] | 67 | </listitem>
|
---|
| 68 | </itemizedlist>
|
---|
| 69 |
|
---|
| 70 | <bridgehead renderas="sect3">Ruby Dependencies</bridgehead>
|
---|
| 71 |
|
---|
[dbdd6ff4] | 72 | <bridgehead renderas="sect4">Required</bridgehead>
|
---|
| 73 | <para role="required">
|
---|
| 74 | <xref linkend="libyaml"/>
|
---|
| 75 | </para>
|
---|
| 76 |
|
---|
[16f3afb3] | 77 | <bridgehead renderas="sect4">Optional</bridgehead>
|
---|
[955b7fd2] | 78 | <para role="optional">
|
---|
| 79 | <xref linkend="doxygen"/>,
|
---|
[cc13920] | 80 | <xref linkend="graphviz"/>,
|
---|
[382633a] | 81 | <xref linkend="rust"/>,
|
---|
[d28648d] | 82 | <xref linkend="tk"/>,
|
---|
[dcd5a063] | 83 | <xref linkend="valgrind"/>,
|
---|
| 84 | &berkeley-db; and
|
---|
[497d485] | 85 | <ulink url="https://dtrace.org/about/">DTrace</ulink>
|
---|
[955b7fd2] | 86 | </para>
|
---|
[16f3afb3] | 87 |
|
---|
[3c95c92] | 88 | &test-use-internet;
|
---|
| 89 |
|
---|
[16f3afb3] | 90 | </sect2>
|
---|
| 91 |
|
---|
| 92 | <sect2 role="installation">
|
---|
| 93 | <title>Installation of Ruby</title>
|
---|
[33884d36] | 94 |
|
---|
[cc13920] | 95 | <para>
|
---|
| 96 | Install <application>Ruby</application> by running the following
|
---|
[75457cc] | 97 | command:
|
---|
[cc13920] | 98 | </para>
|
---|
[16f3afb3] | 99 |
|
---|
[77b45595] | 100 | <screen><userinput>./configure --prefix=/usr \
|
---|
| 101 | --disable-rpath \
|
---|
| 102 | --enable-shared \
|
---|
| 103 | --without-valgrind \
|
---|
| 104 | --without-baseruby \
|
---|
| 105 | ac_cv_func_qsort_r=no \
|
---|
[e02c1e3] | 106 | --docdir=/usr/share/doc/ruby-&ruby-version; &&
|
---|
| 107 | make</userinput></screen>
|
---|
[75457cc] | 108 |
|
---|
| 109 | <para>
|
---|
| 110 | Optionally, build the CAPI documents by running the following
|
---|
| 111 | commands:
|
---|
| 112 | </para>
|
---|
| 113 |
|
---|
[e02c1e3] | 114 | <screen><userinput>make capi</userinput></screen>
|
---|
[16f3afb3] | 115 |
|
---|
[cc13920] | 116 | <para>
|
---|
[0905b41] | 117 | To test the results, issue: <command>make -j1 -k check</command>.
|
---|
| 118 | Note that running the test suite with parallel jobs may cause test
|
---|
[5cdaaee] | 119 | failure output as cryptic <computeroutput>unknown
|
---|
[0905b41] | 120 | object</computeroutput> messages, resulting a summary falsely claiming
|
---|
[af2b317] | 121 | <quote>all tests passed.</quote> If the environment has variables
|
---|
[0905b41] | 122 | related to proxy settings (<envar>all_proxy</envar>,
|
---|
| 123 | <envar>ALL_PROXY</envar>, <envar>http_proxy</envar>, and etc.) set,
|
---|
| 124 | the test suite will bail out early with messages like
|
---|
[27f6955] | 125 | <computeroutput>net/ftp is not found</computeroutput>. Make sure that you
|
---|
| 126 | unset these variables for the test suite. There are over 26,000 tests.
|
---|
[551641f] | 127 | Some tests related to ipv6 may indicate errors. If the
|
---|
[372597e] | 128 | tests are run in a directory that has a world writable component (e.g.
|
---|
[5b78d1c] | 129 | /tmp) then several additional tests may fail.
|
---|
[cc13920] | 130 | </para>
|
---|
[25a9be8a] | 131 |
|
---|
[c4f5f1e] | 132 | <para>
|
---|
| 133 | Now, as the <systemitem class="username">root</systemitem> user:
|
---|
| 134 | </para>
|
---|
| 135 |
|
---|
| 136 | <screen role="root"><userinput>make install</userinput></screen>
|
---|
| 137 |
|
---|
[edfcf34d] | 138 | <note>
|
---|
| 139 | <para>
|
---|
| 140 | If you have Ruby-On-Rails applications installed and did an
|
---|
| 141 | upgrade of <application>Ruby</application> by installing this
|
---|
[eb19100e] | 142 | package, you might need to run an update there, too
|
---|
| 143 | (as the &root; user):
|
---|
[edfcf34d] | 144 | </para>
|
---|
| 145 |
|
---|
[eb19100e] | 146 | <screen role="nodump"><userinput>cd /path/to/web/app
|
---|
[809c6b5] | 147 | bundle update rake</userinput></screen>
|
---|
| 148 |
|
---|
| 149 | <para>
|
---|
| 150 | and restart the webserver which serves the application.
|
---|
| 151 | </para>
|
---|
| 152 |
|
---|
[edfcf34d] | 153 | </note>
|
---|
| 154 |
|
---|
[16f3afb3] | 155 | </sect2>
|
---|
| 156 |
|
---|
| 157 | <sect2 role="commands">
|
---|
| 158 | <title>Command Explanations</title>
|
---|
| 159 |
|
---|
[fbb82131] | 160 | <para>
|
---|
| 161 | <parameter>--disable-rpath</parameter>: This switch disables embedding
|
---|
| 162 | <filename class='directory'>/usr/lib</filename> as a library search
|
---|
| 163 | path into the <command>ruby</command> program. Doing so is not needed
|
---|
| 164 | (because <filename class='directory'>/usr/lib</filename> is a system
|
---|
| 165 | library path) and it may cause the test suite running with the system
|
---|
| 166 | <filename class='libraryfile'>libruby.so</filename> instead of the
|
---|
| 167 | just built one when Ruby has been installed.
|
---|
| 168 | </para>
|
---|
| 169 |
|
---|
[b9d56ad4] | 170 | <para>
|
---|
[0771e2f] | 171 | <parameter>--enable-shared</parameter>: This switch enables building
|
---|
[cc13920] | 172 | the <filename class="libraryfile">libruby</filename> shared library.
|
---|
| 173 | </para>
|
---|
[16f3afb3] | 174 |
|
---|
[25a9be8a] | 175 | <para>
|
---|
| 176 | <parameter>--without-baseruby</parameter>: This switch prevents using the
|
---|
| 177 | system <command>ruby</command> if it is already installed. The build
|
---|
| 178 | system will use the newly built version instead.
|
---|
| 179 | </para>
|
---|
| 180 |
|
---|
[77b45595] | 181 | <para>
|
---|
| 182 | <parameter>ac_cv_func_qsort_r=no</parameter>: This switch prevents
|
---|
| 183 | using the <function>qsort_r</function> function from Glibc. Ruby
|
---|
[8f9d03f] | 184 | makes some aggressive optimization assuming some implementation
|
---|
| 185 | details of the sorting algorithm, but the assumption is not true with
|
---|
| 186 | the Glibc implementation. With this switch Ruby will use its own sort
|
---|
[77b45595] | 187 | implementation instead.
|
---|
| 188 | </para>
|
---|
| 189 |
|
---|
[5d388f2] | 190 | <para>
|
---|
| 191 | <option>--disable-install-doc</option>: This switch disables building and
|
---|
| 192 | installing rdoc indexes and C API documents.
|
---|
| 193 | </para>
|
---|
| 194 |
|
---|
| 195 | <para>
|
---|
| 196 | <option>--disable-install-rdoc</option>: This switch disables building
|
---|
| 197 | and installing rdoc indexes.
|
---|
| 198 | </para>
|
---|
| 199 |
|
---|
| 200 | <para>
|
---|
| 201 | <option>--disable-install-capi</option>: This switch disables building
|
---|
| 202 | and installing C API documents.
|
---|
| 203 | </para>
|
---|
| 204 |
|
---|
[16f3afb3] | 205 | </sect2>
|
---|
| 206 |
|
---|
| 207 | <sect2 role="content">
|
---|
| 208 | <title>Contents</title>
|
---|
| 209 |
|
---|
| 210 | <segmentedlist>
|
---|
| 211 | <segtitle>Installed Programs</segtitle>
|
---|
| 212 | <segtitle>Installed Libraries</segtitle>
|
---|
| 213 | <segtitle>Installed Directories</segtitle>
|
---|
| 214 |
|
---|
| 215 | <seglistitem>
|
---|
[cc13920] | 216 | <seg>
|
---|
[8558044] | 217 | bundle,
|
---|
| 218 | bundler,
|
---|
| 219 | erb,
|
---|
| 220 | gem,
|
---|
| 221 | irb,
|
---|
| 222 | racc,
|
---|
| 223 | rake,
|
---|
| 224 | rbs,
|
---|
[6b8f495] | 225 | rdbg,
|
---|
[8558044] | 226 | rdoc,
|
---|
| 227 | ri,
|
---|
[e4c4af6] | 228 | ruby, and
|
---|
| 229 | typeprof
|
---|
[cc13920] | 230 | </seg>
|
---|
| 231 | <seg>
|
---|
[d28648d] | 232 | libruby.so
|
---|
[cc13920] | 233 | </seg>
|
---|
| 234 | <seg>
|
---|
[6b8f495] | 235 | /usr/include/ruby-&ruby-minor-version;.0,
|
---|
[cc13920] | 236 | /usr/lib/ruby,
|
---|
[7cc1bcd] | 237 | /usr/share/doc/ruby-&ruby-version; and
|
---|
[cc13920] | 238 | /usr/share/ri
|
---|
| 239 | </seg>
|
---|
[16f3afb3] | 240 | </seglistitem>
|
---|
| 241 | </segmentedlist>
|
---|
| 242 |
|
---|
| 243 | <variablelist>
|
---|
| 244 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
| 245 | <?dbfo list-presentation="list"?>
|
---|
| 246 | <?dbhtml list-presentation="table"?>
|
---|
| 247 |
|
---|
[d28648d] | 248 | <varlistentry id="bundle">
|
---|
| 249 | <term><command>bundle</command></term>
|
---|
| 250 | <listitem>
|
---|
| 251 | <para>
|
---|
[4c24eb0a] | 252 | creates bundles of Ruby Gems
|
---|
[d28648d] | 253 | </para>
|
---|
| 254 | <indexterm zone="ruby bundle">
|
---|
| 255 | <primary sortas="b-bundle">bundle</primary>
|
---|
| 256 | </indexterm>
|
---|
| 257 | </listitem>
|
---|
| 258 | </varlistentry>
|
---|
| 259 |
|
---|
| 260 | <varlistentry id="bundler">
|
---|
| 261 | <term><command>bundler</command></term>
|
---|
| 262 | <listitem>
|
---|
| 263 | <para>
|
---|
[4c24eb0a] | 264 | manages an application's dependencies throughout it's lifecycle
|
---|
[d28648d] | 265 | </para>
|
---|
| 266 | <indexterm zone="ruby bundler">
|
---|
| 267 | <primary sortas="b-bundler">bundler</primary>
|
---|
| 268 | </indexterm>
|
---|
| 269 | </listitem>
|
---|
| 270 | </varlistentry>
|
---|
| 271 |
|
---|
[909a015] | 272 | <varlistentry id="erb">
|
---|
| 273 | <term><command>erb</command></term>
|
---|
[16f3afb3] | 274 | <listitem>
|
---|
[cc13920] | 275 | <para>
|
---|
[0771e2f] | 276 | is a command line front-end for eRuby, which provides a templating
|
---|
| 277 | system for <application>Ruby</application>
|
---|
[cc13920] | 278 | </para>
|
---|
[909a015] | 279 | <indexterm zone="ruby erb">
|
---|
| 280 | <primary sortas="b-erb">erb</primary>
|
---|
| 281 | </indexterm>
|
---|
| 282 | </listitem>
|
---|
| 283 | </varlistentry>
|
---|
| 284 |
|
---|
| 285 | <varlistentry id="gem">
|
---|
| 286 | <term><command>gem</command></term>
|
---|
| 287 | <listitem>
|
---|
| 288 | <para>
|
---|
[0771e2f] | 289 | is the command for RubyGems, which is a sophisticated package
|
---|
| 290 | manager for <application>Ruby</application>. This is similar
|
---|
| 291 | to Python's 'pip' command
|
---|
[909a015] | 292 | </para>
|
---|
| 293 | <indexterm zone="ruby gem">
|
---|
| 294 | <primary sortas="b-gem">gem</primary>
|
---|
[16f3afb3] | 295 | </indexterm>
|
---|
| 296 | </listitem>
|
---|
| 297 | </varlistentry>
|
---|
| 298 |
|
---|
| 299 | <varlistentry id="irb">
|
---|
| 300 | <term><command>irb</command></term>
|
---|
| 301 | <listitem>
|
---|
[cc13920] | 302 | <para>
|
---|
| 303 | is the interactive interface for
|
---|
[4c24eb0a] | 304 | <application>Ruby</application>
|
---|
[cc13920] | 305 | </para>
|
---|
[16f3afb3] | 306 | <indexterm zone="ruby irb">
|
---|
| 307 | <primary sortas="b-irb">irb</primary>
|
---|
| 308 | </indexterm>
|
---|
| 309 | </listitem>
|
---|
| 310 | </varlistentry>
|
---|
| 311 |
|
---|
[909a015] | 312 | <varlistentry id="rake">
|
---|
| 313 | <term><command>rake</command></term>
|
---|
[16f3afb3] | 314 | <listitem>
|
---|
[cc13920] | 315 | <para>
|
---|
[0771e2f] | 316 | is a make-like build utility for <application>Ruby</application>
|
---|
[cc13920] | 317 | </para>
|
---|
[909a015] | 318 | <indexterm zone="ruby rake">
|
---|
| 319 | <primary sortas="b-rake">rake</primary>
|
---|
| 320 | </indexterm>
|
---|
| 321 | </listitem>
|
---|
| 322 | </varlistentry>
|
---|
| 323 |
|
---|
[6b8f495] | 324 | <varlistentry id="rdbg">
|
---|
| 325 | <term><command>rdbg</command></term>
|
---|
| 326 | <listitem>
|
---|
| 327 | <para>
|
---|
| 328 | is an interactive debugger for <application>Ruby</application>
|
---|
| 329 | </para>
|
---|
| 330 | <indexterm zone="ruby rdbg">
|
---|
| 331 | <primary sortas="b-rdbg">rdbg</primary>
|
---|
| 332 | </indexterm>
|
---|
| 333 | </listitem>
|
---|
| 334 | </varlistentry>
|
---|
| 335 |
|
---|
[909a015] | 336 | <varlistentry id="rdoc">
|
---|
| 337 | <term><command>rdoc</command></term>
|
---|
| 338 | <listitem>
|
---|
| 339 | <para>
|
---|
[4c24eb0a] | 340 | generates <application>Ruby</application> documentation
|
---|
[909a015] | 341 | </para>
|
---|
| 342 | <indexterm zone="ruby rdoc">
|
---|
| 343 | <primary sortas="b-rdoc">rdoc</primary>
|
---|
[16f3afb3] | 344 | </indexterm>
|
---|
| 345 | </listitem>
|
---|
| 346 | </varlistentry>
|
---|
| 347 |
|
---|
| 348 | <varlistentry id="ri">
|
---|
| 349 | <term><command>ri</command></term>
|
---|
| 350 | <listitem>
|
---|
[cc13920] | 351 | <para>
|
---|
| 352 | displays documentation from a database on
|
---|
[4c24eb0a] | 353 | <application>Ruby</application> classes, modules, and methods
|
---|
[cc13920] | 354 | </para>
|
---|
[16f3afb3] | 355 | <indexterm zone="ruby ri">
|
---|
| 356 | <primary sortas="b-ri">ri</primary>
|
---|
| 357 | </indexterm>
|
---|
| 358 | </listitem>
|
---|
| 359 | </varlistentry>
|
---|
| 360 |
|
---|
[909a015] | 361 | <varlistentry id="ruby-prog">
|
---|
| 362 | <term><command>ruby</command></term>
|
---|
| 363 | <listitem>
|
---|
| 364 | <para>
|
---|
| 365 | is an interpreted scripting language for quick
|
---|
[4c24eb0a] | 366 | and easy object-oriented programming
|
---|
[909a015] | 367 | </para>
|
---|
| 368 | <indexterm zone="ruby ruby-prog">
|
---|
| 369 | <primary sortas="b-ruby">ruby</primary>
|
---|
| 370 | </indexterm>
|
---|
| 371 | </listitem>
|
---|
| 372 | </varlistentry>
|
---|
| 373 |
|
---|
[16f3afb3] | 374 | <varlistentry id="libruby">
|
---|
[92b0b42] | 375 | <term><filename role="libraryfile">libruby.so</filename></term>
|
---|
[16f3afb3] | 376 | <listitem>
|
---|
[cc13920] | 377 | <para>
|
---|
[4c24eb0a] | 378 | contains the API functions required by <application>Ruby</application>
|
---|
[cc13920] | 379 | </para>
|
---|
[16f3afb3] | 380 | <indexterm zone="ruby libruby">
|
---|
| 381 | <primary sortas="c-libruby">libruby.so</primary>
|
---|
| 382 | </indexterm>
|
---|
| 383 | </listitem>
|
---|
| 384 | </varlistentry>
|
---|
| 385 |
|
---|
| 386 | </variablelist>
|
---|
| 387 |
|
---|
| 388 | </sect2>
|
---|
[a1f7daa] | 389 |
|
---|
| 390 | </sect1>
|
---|