このページの2つのバージョン間の差分を表示します。
両方とも前のリビジョン前のリビジョン次のリビジョン | 前のリビジョン | ||
mae3xx_tips:setup_ruby:start [2014/05/09 18:17] – admin | mae3xx_tips:setup_ruby:start [2015/12/03 16:13] (現在) – admin | ||
---|---|---|---|
行 1: | 行 1: | ||
+ | ====== Ruby の導入 ====== | ||
+ | |||
+ | MA-E3xxには、スクリプト言語として | ||
+ | * Python3.4 | ||
+ | * Perl | ||
+ | * LuaJIT | ||
+ | * node.js | ||
+ | がインストールされていますが、Web系の開発などでよく使用される Ruby を導入してみます。 | ||
+ | |||
+ | ※ Rubyなどを追加したIoT向けファームウェアを、[[download_software: | ||
+ | |||
+ | \\ | ||
+ | |||
+ | ===== セットアップ ===== | ||
+ | |||
+ | ==== Ruby本体の導入 ==== | ||
+ | |||
+ | apt-get コマンドで導入します。 | ||
+ | |||
+ | < | ||
+ | user1@plum: | ||
+ | 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:// | ||
+ | Get:2 http:// | ||
+ | Get:3 http:// | ||
+ | Get:4 http:// | ||
+ | Fetched 2540 kB in 6s (391 kB/s) | ||
+ | Selecting previously unselected package libyaml-0-2: | ||
+ | (Reading database ... 17590 files and directories currently installed.) | ||
+ | Preparing to unpack .../ | ||
+ | Unpacking libyaml-0-2: | ||
+ | Selecting previously unselected package ruby. | ||
+ | Preparing to unpack .../ | ||
+ | Unpacking ruby (1:1.9.3.4) ... | ||
+ | Selecting previously unselected package ruby1.9.1. | ||
+ | Preparing to unpack .../ | ||
+ | Unpacking ruby1.9.1 (1.9.3.484-2ubuntu1) ... | ||
+ | Selecting previously unselected package libruby1.9.1. | ||
+ | Preparing to unpack .../ | ||
+ | Unpacking libruby1.9.1 (1.9.3.484-2ubuntu1) ... | ||
+ | Setting up libyaml-0-2: | ||
+ | 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: | ||
+ | localepurge: | ||
+ | |||
+ | Total disk space freed by localepurge: | ||
+ | |||
+ | user1@plum: | ||
+ | </ | ||
+ | |||
+ | \\ | ||
+ | |||
+ | ==== 動作確認 ==== | ||
+ | |||
+ | 実行してみます。 | ||
+ | |||
+ | < | ||
+ | user1@plum: | ||
+ | ruby 1.9.3p484 (2013-11-22 revision 43786) [arm-linux-eabihf] | ||
+ | user1@plum: | ||
+ | </ | ||
+ | |||
+ | ruby-1.9.3 が導入されました。 | ||
+ | |||
+ | \\ | ||
+ | |||
+ | ===== ダウンロード ===== | ||
+ | |||
+ | Ruby を導入済みのファームウェアお試しバージョンを作りました。 | ||
+ | |||
+ | ^ File ^ Stat ^ SHA1SUM | ||
+ | |{{: | ||
+ | |||
+ | ※ JRE, bootloader は含んでおりません。 | ||
+ | |||
+ | \\ | ||
+ | |||
+ | 標準ファームウェアに、下記パッケージを追加してあります。 | ||
+ | |||
+ | < | ||
+ | ii libruby1.9.1 | ||
+ | ii libruby2.0: | ||
+ | ii ruby 1: | ||
+ | ii ruby-serialport | ||
+ | ii ruby1.9.1 | ||
+ | ii ruby2.0 | ||
+ | ii rubygems-integration | ||
+ | </ | ||
+ | |||