目次

Ruby の導入

MA-E3xxには、スクリプト言語として

がインストールされていますが、Web系の開発などでよく使用される Ruby を導入してみます。

※ Rubyなどを追加したIoT向けファームウェアを、MA-E3xx for IoT でダウンロードできますのでお試しください。


セットアップ

Ruby本体の導入

apt-get コマンドで導入します。

user1@plum:~$ sudo apt-get install ruby   
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  libruby1.9.1 libyaml-0-2 ruby1.9.1
Suggested packages:
  ri ruby-dev ruby1.9.1-examples ri1.9.1 graphviz ruby1.9.1-dev ruby-switch
The following NEW packages will be installed:
  libruby1.9.1 libyaml-0-2 ruby ruby1.9.1
0 upgraded, 4 newly installed, 0 to remove and 0 not upgraded.
Need to get 2540 kB of archives.
After this operation, 10.9 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://ports.ubuntu.com/ubuntu-ports/ trusty/main libyaml-0-2 armhf 0.1.4-3ubuntu3 [40.4 kB]
Get:2 http://ports.ubuntu.com/ubuntu-ports/ trusty/main ruby all 1:1.9.3.4 [5334 B]
Get:3 http://ports.ubuntu.com/ubuntu-ports/ trusty/main ruby1.9.1 armhf 1.9.3.484-2ubuntu1 [35.5 kB]
Get:4 http://ports.ubuntu.com/ubuntu-ports/ trusty/main libruby1.9.1 armhf 1.9.3.484-2ubuntu1 [2458 kB]
Fetched 2540 kB in 6s (391 kB/s)                                                                             
Selecting previously unselected package libyaml-0-2:armhf.
(Reading database ... 17590 files and directories currently installed.)
Preparing to unpack .../libyaml-0-2_0.1.4-3ubuntu3_armhf.deb ...
Unpacking libyaml-0-2:armhf (0.1.4-3ubuntu3) ...
Selecting previously unselected package ruby.
Preparing to unpack .../ruby_1%3a1.9.3.4_all.deb ...
Unpacking ruby (1:1.9.3.4) ...
Selecting previously unselected package ruby1.9.1.
Preparing to unpack .../ruby1.9.1_1.9.3.484-2ubuntu1_armhf.deb ...
Unpacking ruby1.9.1 (1.9.3.484-2ubuntu1) ...
Selecting previously unselected package libruby1.9.1.
Preparing to unpack .../libruby1.9.1_1.9.3.484-2ubuntu1_armhf.deb ...
Unpacking libruby1.9.1 (1.9.3.484-2ubuntu1) ...
Setting up libyaml-0-2:armhf (0.1.4-3ubuntu3) ...
Setting up ruby (1:1.9.3.4) ...
Setting up ruby1.9.1 (1.9.3.484-2ubuntu1) ...
Setting up libruby1.9.1 (1.9.3.484-2ubuntu1) ...
Processing triggers for libc-bin (2.19-0ubuntu6) ...
localepurge: Disk space freed in /usr/share/locale: 0 KiB
localepurge: Disk space freed in /usr/share/man: 0 KiB

Total disk space freed by localepurge: 0 KiB

user1@plum:~$


動作確認

実行してみます。

user1@plum:~$ ruby -v      
ruby 1.9.3p484 (2013-11-22 revision 43786) [arm-linux-eabihf]
user1@plum:~$

ruby-1.9.3 が導入されました。


ダウンロード

Ruby を導入済みのファームウェアお試しバージョンを作りました。

File Stat SHA1SUM Info
mae3xx_trusty_ruby_v2_0_0.img2014/05/09 18:16 68.7 MBa0c44ec40120b8f6bda1e289c4f949f6007274dbv2.0.0

※ JRE, bootloader は含んでおりません。


標準ファームウェアに、下記パッケージを追加してあります。

ii  libruby1.9.1                    1.9.3.484-2ubuntu1            armhf        Libraries necessary to run Ruby 1.9.1
ii  libruby2.0:armhf                2.0.0.484-1ubuntu2            armhf        Libraries necessary to run Ruby 2.0
ii  ruby                            1:1.9.3.4                     all          Interpreter of object-oriented scripting language Ruby (default version)
ii  ruby-serialport                 1.3.0-1                       armhf        Library for using RS-232 serial ports from Ruby programs
ii  ruby1.9.1                       1.9.3.484-2ubuntu1            armhf        Interpreter of object-oriented scripting language Ruby
ii  ruby2.0                         2.0.0.484-1ubuntu2            armhf        Interpreter of object-oriented scripting language Ruby
ii  rubygems-integration            1.5                           all          integration of Debian Ruby packages with Rubygems