betahikaru / graphviz-sample

0 stars 1 forks source link

"guard -i" puts error in Listen::Change #1

Open betahikaru opened 10 years ago

betahikaru commented 10 years ago
E, [2014-09-29T01:15:13.893357 #32248] ERROR -- : Listen::Change crashed!
NameError: uninitialized constant Listen::File::Digest
    /Users/betahikaru/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/listen-2.7.9/lib/listen/file.rb:57:in `change'
    /Users/betahikaru/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/listen-2.7.9/lib/listen/change.rb:40:in `change'
    /Users/betahikaru/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/celluloid-0.15.2/lib/celluloid/calls.rb:25:in `public_send'
    /Users/betahikaru/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/celluloid-0.15.2/lib/celluloid/calls.rb:25:in `dispatch'
    /Users/betahikaru/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/celluloid-0.15.2/lib/celluloid/calls.rb:67:in `dispatch'
    /Users/betahikaru/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/celluloid-0.15.2/lib/celluloid/actor.rb:322:in `block in handle_message'
    /Users/betahikaru/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/celluloid-0.15.2/lib/celluloid/actor.rb:416:in `block in task'
    /Users/betahikaru/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/celluloid-0.15.2/lib/celluloid/tasks.rb:55:in `block in initialize'
    /Users/betahikaru/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/celluloid-0.15.2/lib/celluloid/tasks/task_fiber.rb:13:in `block in create'
% ruby -v
ruby 2.1.2p95 (2014-05-08 revision 45877) [x86_64-darwin13.0]
% gem -v
2.2.2
% nl -b a /Users/betahikaru/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/listen-2.7.9/lib/listen/file.rb | head -64 | tail -10
    55            if data[:mtime].to_i + 2 > Time.now.to_f
    56              begin
    57                md5 = Digest::MD5.file(path).digest
    58                record.async.update_file(dir, rel_path, data.merge(md5: md5))
    59                :modified if record_data[:md5] && md5 != record_data[:md5]
    60
    61              rescue SystemCallError
    62                # ignore failed md5
    63              end
    64            end
betahikaru commented 10 years ago

Digest is not initialized. I search "require 'digest/md5'" in listen gem. But I can't find.

% grep -r require ~/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/listen-2.7.9 | grep md5
% grep -r require ~/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/listen-2.7.9 | grep digest

So, I've try to change "file.rb" to require 'digest/md5'.

[betahikaru@BHMBP:~/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/listen-2.7.9/lib/listen]
% diff file.rb~ file.rb
0a1,2
> require 'digest/md5'
>

Then, NameError is not happen in guard -i command.

betahikaru commented 10 years ago

Version of Guard gem

% gem list guard

*** LOCAL GEMS ***

guard (2.6.1)
guard-shell (0.6.1)