compile and install ruby

download by curl.

https://www.ruby-lang.org/ja/downloads/

choice a preview one.

[root@centos6 ~]# curl -O https://cache.ruby-lang.org/pub/ruby/2.6/ruby-2.6.0-preview2.tar.gz

install C Compiler.

[root@centos6 ~]# yum install gcc

==============================================================================================================================
 パッケージ                      アーキテクチャ          バージョン                            リポジトリー              容量
==============================================================================================================================
インストールしています:
 gcc                             x86_64                  4.4.7-23.el6                          base                      10 M
依存性関連でのインストールをします。:
 cloog-ppl                       x86_64                  0.15.7-1.2.el6                        base                      93 k
 cpp                             x86_64                  4.4.7-23.el6                          base                     3.7 M
 glibc-devel                     x86_64                  2.12-1.212.el6                        base                     991 k
 glibc-headers                   x86_64                  2.12-1.212.el6                        base                     620 k
 kernel-headers                  x86_64                  2.6.32-754.2.1.el6                    updates                  4.5 M
 libgomp                         x86_64                  4.4.7-23.el6                          base                     135 k
 mpfr                            x86_64                  2.4.1-6.el6                           base                     157 k
 ppl                             x86_64                  0.10.2-11.el6                         base                     1.3 M

トランザクションの要約
==============================================================================================================================
インストール         9 パッケージ

総ダウンロード容量: 22 M
インストール済み容量: 39 M

install ruby.

[root@centos6 ~]# tar zxf ruby-2.6.0-preview2.tar.gz
[root@centos6 ~]# cd ruby-2.6.0-preview2
[root@centos6 ruby-2.6.0-preview2]# ./configure

MakeFile is created.

-rwxr-xr-x.  1 root root   34K  7月 28 08:02 2018 config.status
-rw-r--r--.  1 root root   154  7月 28 08:02 2018 GNUmakefile
-rw-r--r--.  1 root root   19K  7月 28 08:02 2018 Makefile
-rw-r--r--.  1 root root   99K  7月 28 08:02 2018 uncommon.mk
-rw-r--r--.  1 root root  1.9K  7月 28 08:02 2018 ruby-2.6.pc
-rw-r--r--.  1 root root  1.2M  7月 28 08:02 2018 config.log

make.

[root@centos6 ruby-2.6.0-preview2]# make install

Generating RDoc documentation
Parsing sources...
100% [884/884]  win32/README.win32

Generating RI format into /root/ruby-2.6.0-preview2/.ext/rdoc...

  Files:        884

  Classes:     1325 ( 557 undocumented)
  Modules:      283 ( 113 undocumented)
  Constants:   2192 ( 556 undocumented)
  Attributes:  1077 ( 259 undocumented)
  Methods:    10128 (2207 undocumented)

  Total:      15005 (3692 undocumented)
   75.39% documented

  Elapsed: 176.0s

make install.

[root@centos6 ruby-2.6.0-preview2]# make install

installing binary commands:         /usr/local/bin
installing base libraries:          /usr/local/lib
installing arch files:              /usr/local/lib/ruby/2.6.0/x86_64-linux
installing pkgconfig data:          /usr/local/lib/pkgconfig
installing command scripts:         /usr/local/bin
installing library scripts:         /usr/local/lib/ruby/2.6.0
installing common headers:          /usr/local/include/ruby-2.6.0
installing manpages:                /usr/local/share/man/man1
installing extension objects:       /usr/local/lib/ruby/2.6.0/x86_64-linux
installing extension objects:       /usr/local/lib/ruby/site_ruby/2.6.0/x86_64-linux
installing extension objects:       /usr/local/lib/ruby/vendor_ruby/2.6.0/x86_64-linux
installing extension headers:       /usr/local/include/ruby-2.6.0/x86_64-linux
installing extension scripts:       /usr/local/lib/ruby/2.6.0
installing extension scripts:       /usr/local/lib/ruby/site_ruby/2.6.0
installing extension scripts:       /usr/local/lib/ruby/vendor_ruby/2.6.0
installing extension headers:       /usr/local/include/ruby-2.6.0/ruby
installing default gems from lib:   /usr/local/lib/ruby/gems/2.6.0 (build_info, cache, doc, extensions, gems, specifications)
                                    cmath 1.0.0
                                    csv 1.0.2
                                    fileutils 1.1.0
                                    ipaddr 1.2.0
                                    rdoc 6.0.4
                                    scanf 1.0.0
                                    webrick 1.4.2
installing default gems from ext:   /usr/local/lib/ruby/gems/2.6.0 (build_info, cache, doc, extensions, gems, specifications)
                                    bigdecimal 1.3.4
                                    date 1.0.0
                                    etc 1.0.1
                                    fcntl 1.0.0
                                    fiddle 1.0.0
                                    io-console 0.4.6
                                    json 2.1.0
                                    psych 3.0.3.pre1
                                    sdbm 1.0.0
                                    stringio 0.0.1
                                    strscan 1.0.0
installing bundled gems:            /usr/local/lib/ruby/gems/2.6.0 (build_info, cache, doc, extensions, gems, specifications)
                                    xmlrpc 0.3.0
                                    did_you_mean 1.2.1
                                    power_assert 1.1.1
                                    rake 12.3.1
                                    test-unit 3.2.8
                                    net-telnet 0.1.1
                                    minitest 5.11.3
installing rdoc:                    /usr/local/share/ri/2.6.0/system
installing capi-docs:               /usr/local/share/doc/ruby

test.

[root@centos6 ruby-2.6.0-preview2]# ruby -v
ruby 2.6.0preview2 (2018-05-31 trunk 63539) [x86_64-linux]