@@ -4,35 +4,40 @@ title: "Installing Ruby"
4
4
lang : en
5
5
---
6
6
7
- You can use several tools to install Ruby.
8
- This page describes how to use major package management systems
9
- and third-party tools for managing and installing Ruby
10
- and how to build Ruby from source.
7
+ With package managers or third-party tools, you have plenty of options
8
+ to install and manage Ruby.
11
9
{: .summary}
12
10
11
+ You may already have Ruby installed on your computer. You can check
12
+ inside a [ terminal emulator] [ terminal ] by typing:
13
+
14
+ {% highlight sh %}
15
+ ruby -v
16
+ {% endhighlight %}
17
+
18
+ This should output some information on the installed Ruby version.
13
19
14
20
## Choose Your Installation Method
15
21
16
22
There are several ways to install Ruby:
17
23
18
- * When you are on a UNIX-like operating system, using your system's
19
- ** package manager** is the easiest way of getting started.
20
- However, the packaged Ruby version usually is not the newest one.
24
+ * On a UNIX-like operating system, using your system's ** package
25
+ manager** is easiest. However, the packaged Ruby version may not be
26
+ the newest one.
21
27
* ** Installers** can be used to install a specific or multiple
22
28
Ruby versions. There is also an installer for Windows.
23
- * ** Managers** help you to switch between multiple Ruby installations
29
+ * ** Managers** help you to switch between multiple Ruby versions
24
30
on your system.
25
- * And finally , you can also ** build Ruby from source** .
31
+ * Finally , you can also ** build Ruby from source** .
26
32
27
- The following overview lists available installation methods
28
- for different needs and platforms.
33
+ Here are available installation methods:
29
34
30
35
* [ Package Management Systems] ( #package-management-systems )
31
36
* [ Debian, Ubuntu] ( #apt )
32
37
* [ CentOS, Fedora, RHEL] ( #yum )
33
38
* [ Gentoo] ( #portage )
34
39
* [ Arch Linux] ( #pacman )
35
- * [ OS X ] ( #homebrew )
40
+ * [ macOS ] ( #homebrew )
36
41
* [ FreeBSD] ( #freebsd )
37
42
* [ Solaris, OpenIndiana] ( #solaris )
38
43
* [ Other Distributions] ( #other-systems )
@@ -55,20 +60,19 @@ for different needs and platforms.
55
60
If you cannot compile your own Ruby, and you do not want to use a
56
61
third-party tool, you can use your system's package manager to install Ruby.
57
62
58
- Certain members in the Ruby community feel very strongly that you should
59
- never use a package manager to install Ruby and that you should use tools
60
- instead. While the full list of pros and cons is outside of the scope
61
- of this page, the most basic reason is that most package managers have
62
- older versions of Ruby in their official repositories. If you would like to
63
- use the newest Ruby, make sure you use the correct package name,
64
- or use the tools described further below instead.
63
+ Some members of the Ruby community feel that you should avoid package
64
+ managers to install Ruby and that you should use dedicated tools instead.
65
65
66
+ It's possible that major package managers will install older Ruby
67
+ versions instead of the latest release. To use the latest Ruby release,
68
+ check that the package name matches its version number. Or use a
69
+ dedicated [ installer] [ installers ] .
66
70
67
71
### apt (Debian or Ubuntu)
68
72
{: #apt}
69
73
70
- Debian GNU/Linux and Ubuntu use the apt package manager.
71
- You can use it like this:
74
+ Debian GNU/Linux and Ubuntu use the apt package manager. You can use it
75
+ like this:
72
76
73
77
{% highlight sh %}
74
78
$ sudo apt-get install ruby-full
@@ -101,9 +105,9 @@ Gentoo uses the portage package manager.
101
105
$ sudo emerge dev-lang/ruby
102
106
{% endhighlight %}
103
107
104
- By default, this will try to install versions 1.9 and 2.0,
105
- but more versions are available.
106
- To install a specific version, set ` RUBY_TARGETS ` in your ` make.conf ` .
108
+ By default, this will try to install versions 1.9 and 2.0, but more
109
+ versions are available. To install a specific version, set
110
+ ` RUBY_TARGETS ` in your ` make.conf ` .
107
111
See the [ Gentoo Ruby Project website] [ gentoo-ruby ] for details.
108
112
109
113
@@ -120,13 +124,14 @@ $ sudo pacman -S ruby
120
124
This should install the latest stable Ruby version.
121
125
122
126
123
- ### Homebrew (OS X )
127
+ ### Homebrew (macOS )
124
128
{: #homebrew}
125
129
126
- On macOS (High) Sierra and OS X El Capitan, Ruby 2.0 is included.
130
+ Ruby versions 2.0 and above are included by default in macOS releases
131
+ since at least El Capitan (10.11) all the way through Mojave (10.14).
127
132
128
- Many people on OS X use [ Homebrew] [ homebrew ] as a package manager.
129
- It is really easy to get a newer version of Ruby using Homebrew:
133
+ [ Homebrew] [ homebrew ] is a commonly used package manager on macOS .
134
+ Installing a Ruby using Homebrew is easy :
130
135
131
136
{% highlight sh %}
132
137
$ brew install ruby
@@ -178,48 +183,48 @@ latest version of Ruby.
178
183
### Other Distributions
179
184
{: #other-systems}
180
185
181
- On other systems, you can search the package repository of your
182
- Linux distribution's manager for Ruby, or the third-party tools might be the
183
- right choice for you .
186
+ On other systems, you can search the package repository of your Linux
187
+ distribution's manager for Ruby. Alternatively, you can use a
188
+ [ third-party installer ] [ installers ] .
184
189
185
190
186
191
## Installers
187
192
{: #installers}
188
193
189
- If the version of Ruby provided by your system or package manager is out of
190
- date, a newer one can be installed using a third-party installer.
191
- Some of them also allow you to install multiple versions on the same system;
192
- associated managers can help to switch between the different Rubies.
193
- If you are planning to use [ RVM] ( #rvm ) as a version manager you do not need
194
- a separate installer, it comes with its own.
194
+ If the version of Ruby provided by your system or package manager is out
195
+ of date, a newer one can be installed using a third-party installer.
196
+
197
+ Some installers allow you to install multiple versions on the same
198
+ system; associated managers can help to switch between the different
199
+ Rubies.
200
+
201
+ If you are planning to use [ RVM] ( #rvm ) as a version manager you don't
202
+ need a separate installer, it comes with its own.
195
203
196
204
197
205
### ruby-build
198
206
{: #ruby-build}
199
207
200
- [ ruby-build] [ ruby-build ] is a plugin for [ rbenv] ( #rbenv ) that
201
- allows you to compile and install different versions of Ruby
202
- into arbitrary directories.
203
- ruby-build can also be used as a standalone program without rbenv.
204
- It is available for OS X, Linux, and other UNIX-like operating systems.
208
+ [ ruby-build] [ ruby-build ] is a plugin for [ rbenv] ( #rbenv ) that allows you
209
+ to compile and install different versions of Ruby. ruby-build can also
210
+ be used as a standalone program without rbenv. It is available for macOS,
211
+ Linux, and other UNIX-like operating systems.
205
212
206
213
207
214
### ruby-install
208
215
{: #ruby-install}
209
216
210
217
[ ruby-install] [ ruby-install ] allows you to compile and install different
211
- versions of Ruby into arbitrary directories.
212
- There is also a sibling, [ chruby] ( #chruby ) , which handles switching between
213
- Ruby versions.
214
- It is available for OS X, Linux, and other UNIX-like operating systems.
218
+ versions of Ruby into arbitrary directories. [ chruby] ( #chruby ) is a
219
+ complimentary tool used to switch between Ruby versions. It's available
220
+ for macOS, Linux, and other UNIX-like operating systems.
215
221
216
222
217
223
### RubyInstaller
218
224
{: #rubyinstaller}
219
225
220
- If you are on Windows, there is a great project to help you install Ruby:
221
- [ RubyInstaller] [ rubyinstaller ] . It gives you everything you need to set up
222
- a full Ruby development environment on Windows.
226
+ On Windows, [ RubyInstaller] [ rubyinstaller ] gives you everything you need
227
+ to set up a full Ruby development environment.
223
228
224
229
Just download it, run it, and you are done!
225
230
@@ -230,60 +235,60 @@ Just download it, run it, and you are done!
230
235
If you are installing Ruby in order to use Ruby on Rails,
231
236
you can use the following installers:
232
237
233
- * [ RailsInstaller] [ railsinstaller ] ,
234
- which uses RubyInstaller but gives you
235
- extra tools that help with Rails development.
236
- It supports OS X and Windows.
237
- * [ Bitnami Ruby Stack] [ rubystack ] ,
238
- which provides a complete development environment for Rails.
239
- It supports OS X, Linux, Windows, virtual machines, and cloud images.
238
+ * [ RailsInstaller] [ railsinstaller ] uses [ RubyInstaller] [ rubyinstaller ]
239
+ but gives you extra tools that help with Rails development. It
240
+ supports macOS and Windows.
241
+ * [ Bitnami Ruby Stack] [ rubystack ] provides a complete development
242
+ environment for Rails. It supports macOS, Linux, Windows, virtual
243
+ machines, and cloud images.
240
244
241
245
242
246
## Managers
243
247
{: #managers}
244
248
245
- Many Rubyists use Ruby managers to manage multiple Rubies.
246
- They confer various advantages but are not officially supported.
247
- Their respective communities are very helpful, however.
249
+ Many Rubyists use Ruby managers to manage multiple Rubies. They allow
250
+ easy or even automatic switching between Ruby versions depending on the
251
+ project and other advantages but are not officially supported. You can
252
+ however find support within their respective communities.
248
253
249
254
250
255
### chruby
251
256
{: #chruby}
252
257
253
- [ chruby] [ chruby ] allows you to switch between multiple Rubies.
254
- chruby can manage Rubies installed by [ ruby-install] ( #ruby-install )
255
- or even built from source.
258
+ [ chruby] [ chruby ] allows you to switch between multiple Rubies. It can
259
+ manage Rubies installed by [ ruby-install] ( #ruby-install ) or even built
260
+ from source.
256
261
257
262
258
263
### rbenv
259
264
{: #rbenv}
260
265
261
266
[ rbenv] [ rbenv ] allows you to manage multiple installations of Ruby.
262
- It does not support installing Ruby, but there is a popular plugin
263
- named [ ruby-build ] ( #ruby-build ) to install Ruby.
264
- Both tools are available for OS X, Linux, or other UNIX-like operating systems.
267
+ While it can't install Ruby by default, its [ ruby-build ] ( #ruby-build )
268
+ plugin can. Both tools are available for macOS, Linux, or other
269
+ UNIX-like operating systems.
265
270
266
271
267
272
### RVM ("Ruby Version Manager")
268
273
{: #rvm}
269
274
270
- [ RVM] [ rvm ] allows you to install and manage multiple installations of Ruby
271
- on your system. It can also manage different gemsets.
272
- It is available for OS X , Linux, or other UNIX-like operating systems.
275
+ [ RVM] [ rvm ] allows you to install and manage multiple installations of
276
+ Ruby on your system. It can also manage different gemsets. It is
277
+ available for macOS , Linux, or other UNIX-like operating systems.
273
278
274
279
275
280
### uru
276
281
{: #uru}
277
282
278
283
[ Uru] [ uru ] is a lightweight, multi-platform command line tool that helps you
279
- to use multiple Rubies on OS X , Linux, or Windows systems.
284
+ to use multiple Rubies on macOS , Linux, or Windows systems.
280
285
281
286
282
287
## Building from Source
283
288
{: #building-from-source}
284
289
285
290
Of course, you can install Ruby from source.
286
- [ Download] ( /en/downloads/ ) and unpack a tarball, then just do this:
291
+ [ Download] [ download ] and unpack a tarball, then just do this:
287
292
288
293
{% highlight sh %}
289
294
$ ./configure
@@ -294,6 +299,9 @@ $ sudo make install
294
299
By default, this will install Ruby into ` /usr/local ` .
295
300
To change, pass the ` --prefix=DIR ` option to the ` ./configure ` script.
296
301
302
+ You can find more information about building from source in the [ Ruby
303
+ README file] [ readme ] .
304
+
297
305
Using the third-party tools or package managers might be a better idea,
298
306
though, because the installed Ruby won't be managed by any tools.
299
307
@@ -314,3 +322,7 @@ though, because the installed Ruby won't be managed by any tools.
314
322
[ freebsd-ruby ] : https://wiki.freebsd.org/Ruby
315
323
[ freebsd-ports-collection ] : https://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/ports-using.html
316
324
[ homebrew ] : http://brew.sh/
325
+ [ terminal ] : https://en.wikipedia.org/wiki/List_of_terminal_emulators
326
+ [ download ] : /en/downloads/
327
+ [ installers ] : /en/documentation/installation/#installers
328
+ [ readme ] : https://github.com/ruby/ruby#how-to-compile-and-install
0 commit comments