2013-07-29 1 views
0

나는 내 재치가 꽤 많습니다. 지금까지 쿠비투 12.04에서 rvm을 통해 루비 1.9.3을 설치할 수있었습니다. 커맨드 라인에서 sass, haml 및 coffeescript를 실행할 수도있었습니다. 마지막으로, 경비원을 배치하고 실행했지만 guard-haml 플러그인이 haml과 통신하지 않는 것으로 보입니다. 지금까지, 나는 약간의 어려움없이 실행되는 coffeescript, sass 및 livereload를 얻을 수있었습니다. 그래서 문제는 guardfile 자체이거나 가드가 haml gem을 찾을 수 없다고 생각합니다. guard-haml이 (가) html로 컴파일되지 않았습니다.

Guardfile

:

# Sass 
guard 'sass', :input => 'sass', :output => 'css' 

#CoffeeScript 
guard 'coffeescript', :input => 'coffee', :output => 'js' 

#LiveReload 
guard 'livereload' do 
    watch(%r{.+\.(css|html|js)$}) 
end 

# Sample guardfile block for Guard::Haml 
# You can use some options to change guard-haml configuration 
# :output => 'public'     set output directory for compiled files 
# :input => 'src'      set input directory with haml files 
# :run_at_start => true     compile files when guard starts 
# :notifications => true    send notifictions to Growl/libnotify/Notifu 
# :haml_options => { :ugly => true } pass options to the Haml engine 

guard 'haml' do 
    watch(/^.+(\.html\.haml)/) 
end 

까지 루비에 관한 한, 나는 총 초보자 해요,이는 레일 프로젝트 아니라는 것을 명심하시기 바랍니다. 나는 전처리기를 사용하고있다. 시간 내 주셔서 감사합니다.

답변

0

저는 같은 문제에 직면하고 있습니다. 나는 Gemfile을 사용하고 번들 명령어를 통해 guard를 실행함으로써이 문제를 해결했다. 다음은 도움이되는 단계입니다.

Guardfile : 변경 :

guard 'haml' do 
    watch(/^.+(\.html\.haml)/) 
end 

guard :haml, input: 'haml-src' 

(이 HAML-src 폴더 내부 .haml 파일을 검색 및 폴더 구조의 예를 보존 루트 디렉토리에있는 파일을 .html 중에서 것에 .haml-src/test/my.haml -> test/my.html)

다음과 같이 젬 파일을 만듭니다 :

,210

source 'https://rubygems.org' 

gem 'guard' 
gem 'guard-haml' 
gem 'guard-coffeescript' 
gem 'guard-sass' 
프로젝트 루트 디렉토리에 Gemfile을 추가 한 후 바로 다음 bundle install 명령 bundle exec guard

을 실행