guard / guard-nanoc

A Guard for nanoc
39 stars 9 forks source link

Guard not watching using guard-nanoc #12

Closed justinalm closed 9 years ago

justinalm commented 11 years ago

We have migrated to guard and guard-nanoc, and guard will build the project, but the watch/listen functionality is not working. If we make changes and press return in guard, it will detect the changes and compile them, but it will not do so automatically.

$ guard
11:35:05 - INFO - Guard is using TerminalTitle to send notifications.

11:35:07 - INFO - Compilation succeeded.
11:35:07 - INFO - Guard is now watching at '/Users/almjustin/github/steamclock/steamclocksw.com'
[1] guard(main)> *pressed return*
11:35:20 - INFO - Run all
      update  [0.09s]  output/blog/feed.xml

11:35:22 - INFO - Compilation succeeded.

This is my list of installed gems:

$ gem list

*** LOCAL GEMS ***

adsf (1.1.1)
bootstrap-sass (2.3.1.0)
builder (3.2.0)
bundle (0.0.1)
bundler (1.3.5)
capistrano (2.13.5)
chunky_png (1.2.7)
classifier (1.3.3)
coderay (1.0.9)
colorator (0.1)
colored (1.2)
commander (4.1.3)
compass (0.12.2)
compass-inuit (5.0.1)
compass-normalize (1.4.2)
compass-normalize-plugin (0.4.0)
cri (2.3.0)
directory_watcher (1.4.1)
fast-stemmer (1.0.1)
ffi (1.9.0)
formatador (0.2.4)
fssm (0.2.9)
guard (1.8.2)
guard-nanoc (1.0.1)
highline (1.6.15)
hpricot (0.8.6)
jekyll (1.0.3, 0.12.0)
jekyll-pagination (0.0.4)
json (1.7.6)
kramdown (1.0.2, 0.14.2, 0.14.1, 0.13.8)
liquid (2.4.1)
listen (1.3.0, 1.2.2, 0.7.2)
localtunnel (0.3)
lumberjack (1.0.4)
maruku (0.6.1)
method_source (0.8.2)
mime-types (1.23)
nanoc (3.6.4, 3.5.1, 3.5.0, 3.4.2)
net-scp (1.0.4)
net-sftp (2.0.5)
net-ssh (2.6.8, 2.6.2)
net-ssh-gateway (1.1.0)
nokogiri (1.5.6)
posix-spawn (0.3.6)
pry (0.9.12.2)
pygments.rb (0.5.2, 0.3.3)
rack (1.4.1)
rb-fsevent (0.9.3)
rb-inotify (0.9.0)
rb-kqueue (0.2.0)
rdiscount (1.6.8)
rubygems-update (2.0.6, 1.8.25, 1.8.24)
safe_yaml (0.7.1)
sass (3.2.10, 3.2.8, 3.2.5)
sassy-buttons (0.1.4)
slop (3.4.6)
stringex (1.5.1)
susy (1.0.5)
syntax (1.0.0)
thor (0.18.1)
yajl-ruby (1.1.0)

Ruby is at ruby 1.8.7 (2012-02-08 patchlevel 358) [universal-darwin12.0]

rymai commented 11 years ago

Hi, please share your Guardfile, thanks! Also, you can run Guard in debug mode with guard -d.

netzpirat commented 11 years ago

It's a known problem with Ruby 1.8.7, you need to add proper Readline support. Ruby 1.8.7 is End-of-Life anyway and will not receive any more security updates, so I suggest to install the latest Ruby 2.0 with either RVM or rbenv.

justinalm commented 11 years ago

This is the content of my Guradfile:

guard 'nanoc' do
  watch('config.yaml') # Change this to config.yaml if you use the old config file name
  watch('Rules')
  watch(%r{^(content|layouts|lib)/.*$})
end

I've installed Ruby2.0 with rbenv and and using it now but running guard still doesn't watch the directories.

Here is the debug info when running guard -d:

$ guard -d
13:37:14 - DEBUG - Command execution: emacsclient --eval '1' 2> /dev/null || echo 'N/A'
13:37:15 - INFO - Guard is using TerminalTitle to send notifications.
13:37:15 - DEBUG - Command execution: hash stty
13:37:15 - DEBUG - Guard starts all plugins
13:37:15 - DEBUG - Hook :start_begin executed for Guard::Nanoc
      update  [0.06s]  output/blog/feed.xml

13:37:17 - INFO - Compilation succeeded.
13:37:17 - DEBUG - Hook :start_end executed for Guard::Nanoc
13:37:17 - INFO - Guard is now watching at '/Users/almjustin/github/steamclock/steamclocksw.com'
13:37:17 - DEBUG - Command execution: stty -g 2>/dev/null
13:37:17 - DEBUG - Start interactor
[1] guard(main)> 
rymai commented 11 years ago

Thanks. What is the file you're saving? Are you sure it's catch by a watch definition?

justinalm commented 11 years ago

Here is what I have in the Guardfile of my nanoc project. I used to be able to make changes to any file within the content directory and the changes would show in the output directory. Also, I don’t see anything output in the Terminal window when I make changes. I'm not sure if there is something I’m missing in the configuration of the Guardfile.

guard 'nanoc' do
  watch('config.yaml') # Change this to config.yaml if you use the old config file name
  watch('Rules')
  watch(%r{^(content|layouts|lib)/.*$})
end
denisdefreyne commented 10 years ago

@justinalm Is this issue still relevant to you? I am not sure what is going on here and I’m not able to reproduce it still.

denisdefreyne commented 9 years ago

Will close for now; feel free to open a new issue if this is still a problem.