hack のためのネタ帳, etc,,,

状況

多分、以前もやってるはずなんだけど、ド忘れしてるのでメモ。
Ruby - fssmCygwin で上手く動かない件 と絡むんだけど、
file-system 変更 監視 ruby」でググって、 を参考に
gem install fssm
してから

fssm-test.rb

#!/bin/sh
exec ruby -x "$0" "$@"
#!ruby
# coding: utf-8

require 'fssm'

def notice(base, relative, action)
  puts "#{base}/#{relative} was #{action} at #{`date`}"
end

FSSM.monitor(ARGV[0],'**/*') do
  create {|base, relative| notice base, relative, "created"}
  update {|base, relative| notice base, relative, "updateded"}
  delete {|base, relative| notice base, relative, "dereted"}
end if ARGV.length > 0
みたいなコードを走らせてみたところ
$ ./fssm-test.rb /tmp/fssm-test
Traceback (most recent call last):
        16: from ./fssm-test.rb:16:in `<main>'
        15: from /cygdrive/c/Users/kou/HOME/.gem/ruby/2.6.0/gems/fssm-0.2.10/lib/fssm.rb:70:in `monitor'
        14: from /cygdrive/c/Users/kou/HOME/.gem/ruby/2.6.0/gems/fssm-0.2.10/lib/fssm/monitor.rb:26:in `run'
        13: from /cygdrive/c/Users/kou/HOME/.gem/ruby/2.6.0/gems/fssm-0.2.10/lib/fssm/backends/polling.rb:15:in `run'
        12: from /cygdrive/c/Users/kou/HOME/.gem/ruby/2.6.0/gems/fssm-0.2.10/lib/fssm/backends/polling.rb:15:in `loop'
        11: from /cygdrive/c/Users/kou/HOME/.gem/ruby/2.6.0/gems/fssm-0.2.10/lib/fssm/backends/polling.rb:17:in `block in run'
        10: from /cygdrive/c/Users/kou/HOME/.gem/ruby/2.6.0/gems/fssm-0.2.10/lib/fssm/backends/polling.rb:17:in `each'
         9: from /cygdrive/c/Users/kou/HOME/.gem/ruby/2.6.0/gems/fssm-0.2.10/lib/fssm/backends/polling.rb:17:in `block (2 levels) in run'
         8: from /cygdrive/c/Users/kou/HOME/.gem/ruby/2.6.0/gems/fssm-0.2.10/lib/fssm/state/directory.rb:17:in `refresh'
         7: from /cygdrive/c/Users/kou/HOME/.gem/ruby/2.6.0/gems/fssm-0.2.10/lib/fssm/state/directory.rb:25:in `created'
         6: from /cygdrive/c/Users/kou/HOME/.gem/ruby/2.6.0/gems/fssm-0.2.10/lib/fssm/state/directory.rb:25:in `each'
         5: from /cygdrive/c/Users/kou/HOME/.gem/ruby/2.6.0/gems/fssm-0.2.10/lib/fssm/state/directory.rb:26:in `block in created'
         4: from /cygdrive/c/Users/kou/HOME/.gem/ruby/2.6.0/gems/fssm-0.2.10/lib/fssm/path.rb:31:in `create'
         3: from /cygdrive/c/Users/kou/HOME/.gem/ruby/2.6.0/gems/fssm-0.2.10/lib/fssm/path.rb:55:in `callback_action'
         2: from /cygdrive/c/Users/kou/HOME/.gem/ruby/2.6.0/gems/fssm-0.2.10/lib/fssm/path.rb:69:in `run_callback'
         1: from /cygdrive/c/Users/kou/HOME/.gem/ruby/2.6.0/gems/fssm-0.2.10/lib/fssm/path.rb:81:in `split_path'
/usr/share/ruby/2.6/pathname.rb:522:in `relative_path_from': different prefix: "//tmp/fssm-test/" and "/tmp/fssm-test" (ArgumentError)
みたいなエラーになってしまった。

これ、 で解決出来てるはずなんだけど、無視されてるので、自分の rpos から gem install したいなと。

解決方法

gem install git」でググってみたところ、いくつかページが見つかって、基本的には
の2種類くらいの方法がありそうな感じ。

とりあえず簡単そうな後者だと、
gem install specific_install
gem specific_install -l https://github.com/kou1okada/fssm
で行けた。

コメントをかく


「http://」を含む投稿は禁止されています。

利用規約をご確認のうえご記入下さい

Wiki内検索

フリーエリア

編集にはIDが必要です