Rails, rcovが落ちるのを修正

色々とおかしな状況だったので整理。

Ruby 1.8.7
Rails 2.2.2
rspec 1.1.11
rspec-rails 1.1.11
rcov 0.8.1.2.0

とりあえず、rake specが2回実行されたので、vendor/plugins以下のrspecとrspec-railsを消します。
それから、rake spec:rcovを実行。

% rake spec:rcov

(中略)

/opt/local/lib/ruby/1.8/rexml/formatters/pretty.rb:131:in `[]': no implicit conversion from nil to integer (TypeError)
        from /opt/local/lib/ruby/1.8/rexml/formatters/pretty.rb:131:in `wrap'
        from /opt/local/lib/ruby/1.8/rexml/formatters/pretty.rb:131:in `wrap'
        from /opt/local/lib/ruby/1.8/rexml/formatters/pretty.rb:90:in `write_text'
        from /opt/local/lib/ruby/1.8/rexml/formatters/default.rb:50:in `write'
        from /opt/local/lib/ruby/1.8/rexml/formatters/pretty.rb:75:in `write_element'
        from /opt/local/lib/ruby/1.8/rexml/formatters/pretty.rb:73:in `each'
        from /opt/local/lib/ruby/1.8/rexml/formatters/pretty.rb:73:in `write_element'
        from /opt/local/lib/ruby/1.8/rexml/formatters/default.rb:31:in `write'
        from /opt/local/lib/ruby/1.8/rexml/formatters/pretty.rb:75:in `write_element'
        from /opt/local/lib/ruby/1.8/rexml/formatters/pretty.rb:73:in `each'
        from /opt/local/lib/ruby/1.8/rexml/formatters/pretty.rb:73:in `write_element'
        from /opt/local/lib/ruby/1.8/rexml/formatters/default.rb:31:in `write'
        from /opt/local/lib/ruby/1.8/rexml/formatters/pretty.rb:117:in `write_document'
        from /opt/local/lib/ruby/1.8/rexml/formatters/pretty.rb:111:in `each'
        from /opt/local/lib/ruby/1.8/rexml/formatters/pretty.rb:111:in `write_document'
        from /opt/local/lib/ruby/1.8/rexml/formatters/default.rb:28:in `write'
        from /opt/local/lib/ruby/1.8/rexml/document.rb:195:in `write'
        from (eval):93:in `pretty'
        from /opt/local/lib/ruby/gems/1.8/gems/rcov-0.8.1.2.0/lib/rcov/report.rb:1003:in `create_file'
        from /opt/local/lib/ruby/gems/1.8/gems/rcov-0.8.1.2.0/lib/rcov/report.rb:708:in `execute'
        from /opt/local/lib/ruby/gems/1.8/gems/rcov-0.8.1.2.0/lib/rcov/report.rb:125:in `each'
        from /opt/local/lib/ruby/gems/1.8/gems/rcov-0.8.1.2.0/lib/rcov/report.rb:125:in `each_file_pair_sorted'
        from /opt/local/lib/ruby/gems/1.8/gems/rcov-0.8.1.2.0/lib/rcov/report.rb:707:in `execute'
        from /opt/local/lib/ruby/gems/1.8/gems/rcov-0.8.1.2.0/lib/rcov.rb:640:in `dump_coverage_info'
        from /opt/local/lib/ruby/gems/1.8/gems/rcov-0.8.1.2.0/lib/rcov.rb:640:in `each'
        from /opt/local/lib/ruby/gems/1.8/gems/rcov-0.8.1.2.0/lib/rcov.rb:640:in `dump_coverage_info'
        from /opt/local/lib/ruby/gems/1.8/gems/rcov-0.8.1.2.0/bin/rcov:421
rake aborted!

rexmlがなんかおかしいっぽい。
なので直修正。

vi /opt/local/lib/ruby/1.8/rexml/formatters/pretty.rb:130
+ place = string.rindex(' ', width) || width

めでたくrake spec:rcovが実行されました。

広告

Flash, rascutを導入する(解決)

どうやらrackのバージョンが悪いようで。
一気にバージョンを落としました。

あいかわらずRuby1.8.7だとエラーなので1.8.6です。

% /usr/bin/gem list rack
rack (0.9.1)
% sudo /usr/bin/gem install -v 0.3.0 rack
% sudo /usr/bin/gem uninstall -v 0.9.1 rack

ついでにrascutの引数も新たにlocalhostを加えて・・

% rascut -v Test.as -s -b localhost

http://localhost:3001/

うごいたー!!!

Flash, rascutを導入する

Ruby1.8.7が悪いのか、うまく動いてくれない。

なのでmacに最初から入っているRubyを使うことにしました。
こっちは1.8.6です。

% sudo /usr/bin/gem install rascut
% export PATH=/Developer/SDKs/flex/bin:$PATH
% export _JAVA_OPTIONS=-Duser.language=en

適当なasつくって、

% rascut -v Test.as -s

http://localhost:3001
でswfみれるはず・・・なんですが・・

SWFObject is not defined
http://localhost:3001/
Line 63

みれない・・

open Test.swf
でswf単体は実行することができます。

うー・・