JRubyがRails 3対応してるというし、Using JRubyって本が1月にでたばかりだったので、久しぶりにJRubyを触ってみる。
本をみながらJRuby on Railsアプリをwarにして、Tomcatにデプロイするまでやってみた。
といっても手順は2008年ごろと一緒。このタイミングならではだったのは、rake 0.9.1が最新なのに、warblerは0.8にしか対応してないこと。
なんも気にせずに
$ jruby -S warble
すると
warble aborted! You have already activated rake 0.8.7, but your Gemfile requires rake 0.9.1. Consider using bundle exec.
といわれて怒られてしまう。は?と思って0.8.7を抹殺しようと
warbler-1.3.1 depends on [rake (~> 0.8.7)] If you remove this gems, one or more dependencies will not be met.
warblerは0.8.Xがいるよ、と言われてしまう。ならばGemfileをかえるしかあるまい。
Gemfile.lockがこんなふうになってるので
railties (3.0.7) actionpack (= 3.0.7) activesupport (= 3.0.7) rake (>= 0.8.7) thor (~> 0.14.4) rake (0.9.1)
こうする
railties (3.0.7) actionpack (= 3.0.7) activesupport (= 3.0.7) rake (~> 0.8.7) thor (~> 0.14.4) rake (0.8.7)
保存して
$ jruby -S bundle install
したら
$ jruby -S bundle show
で確認。
* rake (0.8.7)
と出ればよし。