11# ruby-build
22
3- ruby-build is an [ rbenv] ( https://github.com/sstephenson/rbenv ) plugin
4- that provides an ` rbenv install ` command to compile and install
5- different versions of Ruby on UNIX-like systems.
3+ ruby-build is an [ rbenv] ( https://github.com/sstephenson/rbenv ) plugin that
4+ provides an ` rbenv install ` command to compile and install different versions
5+ of Ruby on UNIX-like systems.
66
7- You can also use ruby-build without rbenv in environments where you
8- need precise control over Ruby version installation.
7+ You can also use ruby-build without rbenv in environments where you need
8+ precise control over Ruby version installation.
99
1010
1111## Installation
1212
1313### Installing as an rbenv plugin (recommended)
1414
15- Installing ruby-build as an rbenv plugin will give you access to the
16- ` rbenv install` command.
15+ Installing ruby-build as an rbenv plugin will give you access to the `rbenv
16+ install` command.
1717
1818 git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
1919
20- This will install the latest development version of ruby-build into
21- the ` ~/.rbenv/plugins/ruby-build ` directory. From that directory, you
22- can check out a specific release tag. To update ruby-build, run `git
23- pull` to download the latest changes.
20+ This will install the latest development version of ruby-build into the
21+ ` ~/.rbenv/plugins/ruby-build ` directory. From that directory, you can check out
22+ a specific release tag. To update ruby-build, run ` git pull ` to download the
23+ latest changes.
2424
2525### Installing as a standalone program (advanced)
2626
27- Installing ruby-build as a standalone program will give you access to
28- the ` ruby-build ` command for precise control over Ruby version
29- installation. If you have rbenv installed, you will also be able to
30- use the ` rbenv install ` command.
27+ Installing ruby-build as a standalone program will give you access to the
28+ ` ruby-build ` command for precise control over Ruby version installation. If you
29+ have rbenv installed, you will also be able to use the ` rbenv install ` command.
3130
3231 git clone https://github.com/sstephenson/ruby-build.git
3332 cd ruby-build
3433 ./install.sh
3534
36- This will install ruby-build into ` /usr/local ` . If you do not have
37- write permission to ` /usr/local ` , you will need to run `sudo
38- ./install.sh` instead. You can install to a different prefix by
39- setting the ` PREFIX ` environment variable.
35+ This will install ruby-build into ` /usr/local ` . If you do not have write
36+ permission to ` /usr/local ` , you will need to run ` sudo ./install.sh ` instead.
37+ You can install to a different prefix by setting the ` PREFIX ` environment
38+ variable.
4039
41- To update ruby-build after it has been installed, run ` git pull ` in
42- your cloned copy of the repository, then re-run the install script.
40+ To update ruby-build after it has been installed, run ` git pull ` in your cloned
41+ copy of the repository, then re-run the install script.
4342
4443### Installing with Homebrew (for OS X users)
4544
46- Mac OS X users can install ruby-build with the
47- [ Homebrew] ( http://brew.sh ) package manager. This
48- will give you access to the ` ruby-build ` command. If you have rbenv
49- installed, you will also be able to use the ` rbenv install ` command.
45+ Mac OS X users can install ruby-build with the [ Homebrew] ( http://brew.sh )
46+ package manager. This will give you access to the ` ruby-build ` command. If you
47+ have rbenv installed, you will also be able to use the ` rbenv install ` command.
5048
51- * This is the recommended method of installation if you installed rbenv
52- with Homebrew.*
49+ * This is the recommended method of installation if you installed rbenv with
50+ Homebrew.*
5351
5452 brew install ruby-build
5553
@@ -62,161 +60,148 @@ Or, if you would like to install the latest development release:
6260
6361### Using ` rbenv install ` with rbenv
6462
65- To install a Ruby version for use with rbenv, run ` rbenv install ` with
66- the exact name of the version you want to install. For example,
63+ To install a Ruby version for use with rbenv, run ` rbenv install ` with the
64+ exact name of the version you want to install. For example,
6765
6866 rbenv install 1.9.3-p448
6967
70- Ruby versions will be installed into a directory of the same name
71- under ` ~/.rbenv/versions ` .
68+ Ruby versions will be installed into a directory of the same name under
69+ ` ~/.rbenv/versions ` .
7270
73- To see a list of all available Ruby versions, run ` rbenv install --list ` .
74- You may also tab-complete available Ruby
75- versions if your rbenv installation is properly configured.
71+ To see a list of all available Ruby versions, run ` rbenv install --list ` . You
72+ may also tab-complete available Ruby versions if your rbenv installation is
73+ properly configured.
7674
7775### Using ` ruby-build ` standalone
7876
79- If you have installed ruby-build as a standalone program, you can use
80- the ` ruby-build ` command to compile and install Ruby versions into
81- specific locations.
77+ If you have installed ruby-build as a standalone program, you can use the
78+ ` ruby-build ` command to compile and install Ruby versions into specific
79+ locations.
8280
83- Run the ` ruby-build ` command with the exact name of the version you
84- want to install and the full path where you want to install it. For
85- example,
81+ Run the ` ruby-build ` command with the exact name of the version you want to
82+ install and the full path where you want to install it. For example,
8683
8784 ruby-build 1.9.3-p448 ~/local/ruby-1.9.3-p448
8885
89- To see a list of all available Ruby versions, run `ruby-build
90- --definitions`.
86+ To see a list of all available Ruby versions, run ` ruby-build --definitions ` .
9187
92- Pass the ` -v ` or ` --verbose ` flag to ` ruby-build ` as the first
93- argument to see what's happening under the hood.
88+ Pass the ` -v ` or ` --verbose ` flag to ` ruby-build ` as the first argument to see
89+ what's happening under the hood.
9490
9591### Custom definitions
9692
97- Both ` rbenv install ` and ` ruby-build ` accept a path to a custom
98- definition file in place of a version name. Custom definitions let you
99- develop and install versions of Ruby that are not yet supported by
100- ruby-build.
93+ Both ` rbenv install ` and ` ruby-build ` accept a path to a custom definition file
94+ in place of a version name. Custom definitions let you develop and install
95+ versions of Ruby that are not yet supported by ruby-build.
10196
102- See the [ ruby-build built-in
103- definitions] ( https://github.com/sstephenson/ruby-build/tree/master/share/ruby-build )
104- as a starting point for custom definition files.
97+ See the [ ruby-build built-in definitions] [ definitions ] as a starting point for
98+ custom definition files.
99+
100+ [ definitions ] : https://github.com/sstephenson/ruby-build/tree/master/share/ruby-build
105101
106102### Special environment variables
107103
108- You can set certain environment variables to control the build
109- process.
104+ You can set certain environment variables to control the build process.
110105
111106* ` TMPDIR ` sets the location where ruby-build stores temporary files.
112- * ` RUBY_BUILD_BUILD_PATH ` sets the location in which sources are
113- downloaded and built. By default, this is a subdirectory of
114- ` TMPDIR ` .
115- * ` RUBY_BUILD_CACHE_PATH ` , if set, specifies a directory to use for
116- caching downloaded package files.
117- * ` RUBY_BUILD_MIRROR_URL ` overrides the default mirror URL root to one
118- of your choosing.
119- * ` RUBY_BUILD_SKIP_MIRROR ` , if set, forces ruby-build to download
120- packages from their original source URLs instead of using a mirror.
107+ * ` RUBY_BUILD_BUILD_PATH ` sets the location in which sources are downloaded and
108+ built. By default, this is a subdirectory of ` TMPDIR ` .
109+ * ` RUBY_BUILD_CACHE_PATH ` , if set, specifies a directory to use for caching
110+ downloaded package files.
111+ * ` RUBY_BUILD_MIRROR_URL ` overrides the default mirror URL root to one of your
112+ choosing.
113+ * ` RUBY_BUILD_SKIP_MIRROR ` , if set, forces ruby-build to download packages from
114+ their original source URLs instead of using a mirror.
121115* ` CC ` sets the path to the C compiler.
122116* ` CONFIGURE_OPTS ` lets you pass additional options to ` ./configure ` .
123- * ` MAKE ` lets you override the command to use for ` make ` . Useful for
124- specifying GNU make (` gmake ` ) on some systems.
125- * ` MAKE_OPTS ` (or ` MAKEOPTS ` ) lets you pass additional options to
126- ` make ` .
127- * ` RUBY_CONFIGURE_OPTS ` and ` RUBY_MAKE_OPTS ` allow you to specify
128- configure and make options for buildling MRI. These variables will
129- be passed to Ruby only, not any dependent packages (e.g. libyaml).
117+ * ` MAKE ` lets you override the command to use for ` make ` . Useful for specifying
118+ GNU make (` gmake ` ) on some systems.
119+ * ` MAKE_OPTS ` (or ` MAKEOPTS ` ) lets you pass additional options to ` make ` .
120+ * ` RUBY_CONFIGURE_OPTS ` and ` RUBY_MAKE_OPTS ` allow you to specify configure and
121+ make options for buildling MRI. These variables will be passed to Ruby only,
122+ not any dependent packages (e.g. libyaml).
130123
131124### Checksum verification
132125
133- If you have the ` md5 ` , ` openssl ` , or ` md5sum ` tool installed,
134- ruby-build will automatically verify the MD5 checksum of each
135- downloaded package before installing it.
126+ If you have the ` md5 ` , ` openssl ` , or ` md5sum ` tool installed, ruby-build will
127+ automatically verify the MD5 checksum of each downloaded package before
128+ installing it.
136129
137- Checksums are optional and specified as anchors on the package URL in
138- each definition. (All bundled definitions include checksums.)
130+ Checksums are optional and specified as anchors on the package URL in each
131+ definition. (All bundled definitions include checksums.)
139132
140133### Package download mirrors
141134
142- ruby-build will first attempt to download package files from a mirror
143- hosted on Amazon CloudFront. If a package is not available on the
144- mirror, if the mirror is down, or if the download is corrupt,
145- ruby-build will fall back to the official URL specified in the
146- defintion file.
135+ ruby-build will first attempt to download package files from a mirror hosted on
136+ Amazon CloudFront. If a package is not available on the mirror, if the mirror
137+ is down, or if the download is corrupt, ruby-build will fall back to the
138+ official URL specified in the defintion file.
147139
148140You can point ruby-build to another mirror by specifying the
149- ` RUBY_BUILD_MIRROR_URL ` environment variable--useful if you'd like to
150- run your own local mirror, for example. Package mirror URLs are
151- constructed by joining this variable with the MD5 checksum of the
152- package file.
141+ ` RUBY_BUILD_MIRROR_URL ` environment variable--useful if you'd like to run your
142+ own local mirror, for example. Package mirror URLs are constructed by joining
143+ this variable with the MD5 checksum of the package file.
153144
154- If you don't have an MD5 program installed, ruby-build will skip the
155- download mirror and use official URLs instead. You can force
156- ruby-build to bypass the mirror by setting the
157- ` RUBY_BUILD_SKIP_MIRROR ` environment variable.
145+ If you don't have an MD5 program installed, ruby-build will skip the download
146+ mirror and use official URLs instead. You can force ruby-build to bypass the
147+ mirror by setting the ` RUBY_BUILD_SKIP_MIRROR ` environment variable.
158148
159149The official ruby-build download mirror is sponsored by
160150[ 37signals] ( http://37signals.com/ ) .
161151
162152### Package download caching
163153
164- You can instruct ruby-build to keep a local cache of downloaded
165- package files by setting the ` RUBY_BUILD_CACHE_PATH ` environment
166- variable. When set, package files will be kept in this directory after
167- the first successful download and reused by subsequent invocations of
168- ` ruby-build ` and ` rbenv install ` .
154+ You can instruct ruby-build to keep a local cache of downloaded package files
155+ by setting the ` RUBY_BUILD_CACHE_PATH ` environment variable. When set, package
156+ files will be kept in this directory after the first successful download and
157+ reused by subsequent invocations of ` ruby-build ` and ` rbenv install ` .
169158
170- The ` rbenv install ` command defaults this path to ` ~/.rbenv/cache ` , so
171- in most cases you can enable download caching simply by creating that
172- directory.
159+ The ` rbenv install ` command defaults this path to ` ~/.rbenv/cache ` , so in most
160+ cases you can enable download caching simply by creating that directory.
173161
174162### Keeping the build directory after installation
175163
176- Both ` ruby-build ` and ` rbenv install ` accept the ` -k ` or ` --keep `
177- flag, which tells ruby-build to keep the downloaded source after
178- installation. This can be useful if you need to use ` gdb ` and
179- ` memprof ` with Ruby.
164+ Both ` ruby-build ` and ` rbenv install ` accept the ` -k ` or ` --keep ` flag, which
165+ tells ruby-build to keep the downloaded source after installation. This can be
166+ useful if you need to use ` gdb ` and ` memprof ` with Ruby.
180167
181- Source code will be kept in a parallel directory tree
182- ` ~/.rbenv/sources ` when using ` --keep ` with the ` rbenv install `
183- command. You should specify the location of the source code with the
184- ` RUBY_BUILD_BUILD_PATH ` environment variable when using ` --keep ` with
185- ` ruby-build ` .
168+ Source code will be kept in a parallel directory tree ` ~/.rbenv/sources ` when
169+ using ` --keep ` with the ` rbenv install ` command. You should specify the
170+ location of the source code with the ` RUBY_BUILD_BUILD_PATH ` environment
171+ variable when using ` --keep ` with ` ruby-build ` .
186172
187173
188174## Getting Help
189175
190- Please see the [ ruby-build
191- wiki ] ( https://github.com/sstephenson/ruby-build/wiki ) for solutions to
192- common problems.
176+ Please see the [ ruby-build wiki ] [ wiki ] for solutions to common problems.
177+
178+ [ wiki ] : https://github.com/sstephenson/ruby-build/wiki
193179
194180If you can't find an answer on the wiki, open an issue on the [ issue
195- tracker] ( https://github.com/sstephenson/ruby-build/issues ) . Be sure to
196- include the full build log for build failures.
181+ tracker] ( https://github.com/sstephenson/ruby-build/issues ) . Be sure to include
182+ the full build log for build failures.
197183
198184
199185### License
200186
201187(The MIT License)
202188
203- Copyright (c) 2012 Sam Stephenson
204-
205- Permission is hereby granted, free of charge, to any person obtaining
206- a copy of this software and associated documentation files (the
207- "Software"), to deal in the Software without restriction, including
208- without limitation the rights to use, copy, modify, merge, publish,
209- distribute, sublicense, and/or sell copies of the Software, and to
210- permit persons to whom the Software is furnished to do so, subject to
211- the following conditions:
212-
213- The above copyright notice and this permission notice shall be
214- included in all copies or substantial portions of the Software.
215-
216- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
217- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
218- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
219- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
220- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
221- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
222- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
189+ Copyright (c) 2012-2013 Sam Stephenson
190+
191+ Permission is hereby granted, free of charge, to any person obtaining a copy of
192+ this software and associated documentation files (the "Software"), to deal in
193+ the Software without restriction, including without limitation the rights to
194+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
195+ of the Software, and to permit persons to whom the Software is furnished to do
196+ so, subject to the following conditions:
197+
198+ The above copyright notice and this permission notice shall be included in all
199+ copies or substantial portions of the Software.
200+
201+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
202+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
203+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
204+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
205+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
206+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
207+ SOFTWARE.
0 commit comments