めまいプログラマーの徒然

小脳出血でめまいをおこしている プログラマの忘備録

CentOS 7.3 に mruby をインストールする。

PCには CentOS 7.3 と Windows 10 をデュアブートでインストールしています。CentOS 側に mruby をインストールしてみます。

mruby は Github よりソースをダウンロードしてビルドします。(他の方法を知りません?)

先ず、必要なプログラムの準備。

ruby と bison が必要になります。

root になってそれぞれインストールします。

# yum install ruby

# yum install bison

git を使ってソースをダウンロードします。

git はインストールされていたのでそのまま使用します。

$ git clone https://github.com/mruby/mruby.git

Cloning into 'mruby'...
remote: Counting objects: 36077, done.
remote: Compressing objects: 100% (77/77), done.
remote: Total 36077 (delta 36), reused 0 (delta 0), pack-reused 35999
Receiving objects: 100% (36077/36077), 7.90 MiB | 1.64 MiB/s, done.
Resolving deltas: 100% (22432/22432), done.

mruby ディレクトリが出来上がり、その中に無事、ダウンロードが完了しています。

$ cd mruby
$ ls -l
合計 120
-rw-rw-r--.  1 white white   861  1月 15 12:14 AUTHORS
-rw-rw-r--.  1 white white  2357  1月 15 12:14 CONTRIBUTING.md
-rw-rw-r--.  1 white white   176  1月 15 12:14 LEGAL
-rw-rw-r--.  1 white white  1061  1月 15 12:14 MITL
-rw-rw-r--.  1 white white   277  1月 15 12:14 Makefile
-rw-rw-r--.  1 white white   343  1月 15 12:14 NEWS
-rw-rw-r--.  1 white white  3866  1月 15 12:14 README.md
-rw-rw-r--.  1 white white  4673  1月 15 12:14 Rakefile
-rw-rw-r--.  1 white white   253  1月 15 12:14 TODO
-rw-rw-r--.  1 white white   542  1月 15 12:14 appveyor.yml
-rw-rw-r--.  1 white white   912  1月 15 12:14 appveyor_config.rb
drwxrwxr-x.  2 white white  4096  1月 15 12:14 benchmark
drwxrwxr-x.  2 white white  4096  1月 15 12:14 bin
-rw-rw-r--.  1 white white  3799  1月 15 12:14 build_config.rb
drwxrwxr-x.  3 white white  4096  1月 15 12:14 doc
drwxrwxr-x.  4 white white  4096  1月 15 12:14 examples
drwxrwxr-x.  3 white white  4096  1月 15 12:14 include
drwxrwxr-x.  3 white white  4096  1月 15 12:14 lib
-rwxrwxr-x.  1 white white 13468  1月 15 12:14 minirake
drwxrwxr-x. 36 white white  4096  1月 15 12:14 mrbgems
drwxrwxr-x.  2 white white  4096  1月 15 12:14 mrblib
-rw-rw-r--.  1 white white   615  1月 15 12:14 mruby-source.gemspec
drwxrwxr-x.  3 white white  4096  1月 15 12:14 src
drwxrwxr-x.  3 white white  4096  1月 15 12:14 tasks
drwxrwxr-x.  3 white white  4096  1月 15 12:14 test
-rw-rw-r--.  1 white white  1065  1月 15 12:14 travis_config.rb

その中に minirake がありますので実行します。

$ ./minirake 

ビルドが開始されます。

暫くすると bin 内にプログラムが出来上がっています。

-rwxrwxr-x. 1 white white 1536056  1月 15 12:17 mirb
-rwxrwxr-x. 1 white white 1048688  1月 15 12:17 mrbc
-rwxrwxr-x. 1 white white 1642472  1月 15 12:17 mrdb
-rwxrwxr-x. 1 white white 1524064  1月 15 12:17 mruby
-rwxrwxr-x. 1 white white 1255632  1月 15 12:17 mruby-strip

バージョンを確認してみます。

$ ./mruby -version
mruby 1.2.0 (2015-11-17)