2016-07-31 13 views
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] 
} 

のように見えますか?それは修正できますか?

+0

このスクリプトはどのように実行しましたか? – avellable

+0

node.jsコマンドラインを 'watchr watchr.rb'コマンドで使用しました。@avellable – ALEX

答えて

0

ファイルをwatchr.watchrにリネームすると修正されるはずです。

$ watchr watchr.watchr 
関連する問題