0
watchrを使用して私のスタイラスとhamlファイルを見たりコンパイルしたりしますが、watchrコマンドを実行するとエラーメッセージが表示されます:<main>: undefined method watch' for main:Object (NoMethodError)
。 マイwatchr.rbファイルには、私はこの問題を解決するにはどうすればよいこのWatchr:定義されていないmainメソッドのwatch:オブジェクト
def compile_haml
%x[haml index.haml ../index.html]
end
def compile_stylus
%x[stylus style.styl -o ../style.css]
end
watch("index.haml") { |x|
%x[haml index.haml ../index.html]
}
watch("style.styl") { |x|
%x[stylus style.styl -o ../style.css]
}
のように見えますか?それは修正できますか?
このスクリプトはどのように実行しましたか? – avellable
node.jsコマンドラインを 'watchr watchr.rb'コマンドで使用しました。@avellable – ALEX