2011年1月23日日曜日

Ruote2.1 ワークフローエンジン:クイックスタート

Ruote2.1はおもにRuby 1.9.1でテストされています。多分 Ruby 1.8.7でもうまくいくのではないでしょうか。
・・・と書かれているので、Ruby1.8.7の環境で試しています。ちなみに開発環境はMac。

このクイックスタートは最低限のプロセスが実行されることを狙っています。これは特別?なサンプルです。

Ruote2.1の取得

最近のバージョンのgitがあるなら、つぎのコマンドラインで実行できます。

ちなみに私のgitのバージョンは
$ git --version
git version 1.7.1.1

git clone git://github.com/jmettraux/ruote.git

Cloning into route...
fatal: The remote end hung up unexpectedly

んー。エラーが出てしまったようです。
Mac環境なので、Mac版のgitをhttp://code.google.com/p/git-osx-installer/
からダウンロードしてみます。
環境がMacなので git-1.7.3.5-x86_64-leopard.dmg をダウンロードし実行します。
インストーラーが起動します。

まだターミナル上でgitのバージョンを確認しても変わらず1.7.1.1が表示されるので、Pathの設定が必要か・・・
とりあえずREADMEファイルを読んでみる。

/usr/local/gitディレクトリが作成されるとのこと。確認するとたしかにあります。
この更にbinディレクトリのgitコマンドでバージョンを確認すると

$ ./git --version
git version 1.7.3.5

やはりこちらに最新バージョンがインストールされました。

$ /usr/local/git/bin/git clone git://github.com/jmettraux/ruote.git
Cloning into ruote...
remote: Counting objects: 18891, done.
remote: Compressing objects: 100% (5471/5471), done.
remote: Total 18891 (delta 13903), reused 18101 (delta 13311)
Receiving objects: 100% (18891/18891), 3.65 MiB | 882 KiB/s, done.
Resolving deltas: 100% (13903/13903), done.

最新バージョンのgitで実行したら、上手くダウンロードできたようです。

ruoteディレクトリがカレントディレクトリに作成されました。

では更に手順通りに

cd ruote
git checkout ruote2.1

$ /usr/local/git/bin/git checkout ruote2.1
Already on 'ruote2.1'

すでにあると言われてしまった。
では先に進めます。

$ rake build
(in /Users/***/NetBeansProjects/ruote)
gem build ruote.gemspec
warning: Insecure world writable dir /usr/local in PATH, mode 040777
Successfully built RubyGem
Name: ruote
Version: 2.1.12
File: ruote-2.1.12.gem
mkdir pkg
mv ruote-2.1.12.gem pkg/

うまくいった模様。さらに・・・
$ gem install pkg/ruote-2.1.12.gem を実行。
WARNING: Installing to ~/.gem since /Library/Ruby/Gems/1.8 and
/usr/bin aren't both writable.
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/installer.rb:149: warning: Insecure world writable dir /usr/local in PATH, mode 040777
WARNING: You don't have /Users/***/.gem/ruby/1.8/bin in your PATH,
gem executables will not run.
Successfully installed rufus-json-0.2.5
Successfully installed rufus-cloche-0.1.20
Successfully installed rufus-dollar-1.0.4
Successfully installed rufus-mnemo-1.2.0
Successfully installed tzinfo-0.3.24
Successfully installed rufus-scheduler-2.0.8
Successfully installed sexp_processor-3.0.5
Successfully installed ruby_parser-2.0.5
Successfully installed rufus-treechecker-1.0.4
Successfully installed ruote-2.1.12
10 gems installed
Installing ri documentation for rufus-json-0.2.5...
Installing ri documentation for rufus-cloche-0.1.20...

sudoを使わなかったから警告か・・・

$ sudo gem install pkg/ruote-2.1.12.gem
Password:
Successfully installed ruote-2.1.12
1 gem installed
Installing ri documentation for ruote-2.1.12...
Installing RDoc documentation for ruote-2.1.12...

やり直しました。


# if you're using C (MRI) Ruby :
gem install yajl-ruby

# if you're using JRuby :
gem install json-jruby

# on windows :
gem install json_pure

私の環境はCRuby(Matz' Ruby Implementation)なので

$ sudo gem install yajl-rubyBuilding native extensions. This could take a while...
Successfully installed yajl-ruby-0.7.9
1 gem installed
Installing ri documentation for yajl-ruby-0.7.9...
Installing RDoc documentation for yajl-ruby-0.7.9...

一応ここまでは順調。

最初の実行(First run)

ruote_quickstart.rbが用意されているので、これを実行します。

$ ruby examples/ruote_quickstart.rb
I received a message from Alice

これで確認完了なのか?

0 件のコメント:

コメントを投稿