jpmobile(Git) と Rspec(onRails)

一方で、rake spec に失敗するようになってしまった。

Your RSpec on Rails plugin is incompatible with your installed RSpec.

RSpec          : 20080526202855
RSpec on Rails : 20080309210001

Make sure your RSpec on Rails plugin is compatible with your RSpec gem.
See http://rspec.rubyforge.org/documentation/rails/install.html for details.

うーむ、バージョンいじったつもりは無いけど。一応「script/plugin update」してみるけど変わらず。

いろいろ試行錯誤

RubyGems の方の RSpecもおかしい、spec --version も利かない。インストールしなおしてみる。一度 uninstall して(All)、再び install。
やっぱりエラー。

[2533] spec --version
/usr/local/lib/site_ruby/1.8/rubygems.rb:578:in `report_activate_error': Could not find RubyGem hoe (>= 1.8.1) (Gem::LoadError)
        from /usr/local/lib/site_ruby/1.8/rubygems.rb:134:in `activate'
        from /usr/local/lib/site_ruby/1.8/rubygems.rb:158:in `activate'
        from /usr/local/lib/site_ruby/1.8/rubygems.rb:157:in `each'
        from /usr/local/lib/site_ruby/1.8/rubygems.rb:157:in `activate'
        from /usr/local/lib/site_ruby/1.8/rubygems.rb:49:in `gem'
        from /usr/bin/spec:18

「hoe」が無いからって言ってるように見えるが hoe ってなんだ。というかアンインストール前のエラーもこんな感じだったと思う、ちゃんと見てなかったけど。

[2532] gem list -r -d hoe

REMOTE GEMS ***
hoe (1.8.2) Author: Ryan Davis Rubyforge: http://rubyforge.org/projects/seattlerb Homepage: http://rubyforge.org/projects/seattlerb/ Hoe is a simple rake/rubygems helper for project Rakefiles
そんな物があるのね。でもなんで依存性で解決されてないんだろう。
[2535] sudo gem install hoe
Successfully installed rubyforge-1.0.1
Successfully installed hoe-1.8.2
2 gems installed
Installing ri documentation for rubyforge-1.0.1...
Installing ri documentation for hoe-1.8.2...
Installing RDoc documentation for rubyforge-1.0.1...
Installing RDoc documentation for hoe-1.8.2...
もともと --version は効かなかったのね、-v で。
[2539] spec -v
rspec 1.1.11
だからと言って Railsアプリケーション(photo の jpmobileブランチ)での rake spec は失敗、エラーはちょっと変わった。
/usr/lib/ruby/gems/1.8/gems/activesupport-2.1.1/lib/active_support/dependencies.rb:276:in `load_missing_constant': uninitialized constant Spec::VERSION::BUILD_TIME_UTC (NameError)
プラグインrspec じゃなくて今入れた RSpec を使っててバージョン詳細(UTC)が見付らないと言ってるとか。

プラグイン再インストール

一度プラグインをリムーブしてみる。で、折角だから Git でプラグイン最新版(開発版)、インストールのパターンは「Home · dchelimsky/rspec-rails Wiki · GitHub」より。
[2559] script/plugin install git://github.com/dchelimsky/rspec.git
removing: /home/hs9587/rails/photo_sid/vendor/plugins/rspec/.git
Initialized empty Git repository in /home/hs9587/rails/photo_sid/vendor/plugins/rspec/.git/
remote: Counting objects: 918, done.
remote: Compressing objects: 100% (836/836), done.
remote: Total 918 (delta 381), reused 299 (delta 39)
Receiving objects: 100% (918/918), 404.74 KiB | 49 KiB/s, done.
Resolving deltas: 100% (381/381), done.
[2561] script/plugin install git://github.com/dchelimsky/rspec-rails.git
removing: /home/hs9587/rails/photo_sid/vendor/plugins/rspec-rails/.git
Initialized empty Git repository in /home/hs9587/rails/photo_sid/vendor/plugins/rspec-rails/.git/
remote: Counting objects: 438, done.
remote: Compressing objects: 100% (374/374), done.
remote: Total 438 (delta 165), reused 156 (delta 20)
Receiving objects: 100% (438/438), 106.00 KiB | 20 KiB/s, done.
Resolving deltas: 100% (165/165), done.
おお、ちゃんと rake spec 出来た。しかも、SVN(rspec.rubyforge.org) 方面ので出てた次のエラーも出ない。
DEPRECATION WARNING: Inflector is deprecated! Use ActiveSupport::Inflector instead.  See http://www.rubyonrails.org/deprecation for details. (called from method_missing at /home/hs9587/rails/photo/vendor/plugins/rspec/lib/spec/matchers/have.rb:20)
と言う間に、rspec_on_rails が無くなって rspec-rails になってる。
svn関係
手元の svn管理もそれなり手順必要だった。
  1. 取り敢えず vendor/plugins ディレクトリで作業。
  2. add と commit
    1. rspec-railssvn add
    2. jpmoble を svn add
    3. commit
  3. delete と commit
    1. rspec_on_railssvn delete
    2. commit
  4. rspec の調整
    1. rspecsvn deleteしようにも .svnが無いので云々と
    2. 一時的に mv改名
    3. 改めて svn delete
    4. commit
    5. mv改名戻す
    6. rspecsvn add
    7. commit
で、何と言うか、rake spec 通る、trans_SID も行く(様な気がする)、ので、良いんじゃないかな。 git と rspec_on_rails不調の因果関係とかちゃんと追求してないけど、まあ。