guard/guard — Issue #160: guard list / guard -T Errors
Author: earlonrails
Created: 2011-10-12 18:28:49+00:00
State: open

Hello again all!

I was using 0.7.0 before my recent pull was accepted. Now I am trying to use 0.8.4 and I get this when I do guard list or guard -T.
I saw that this was an error before. I wonder if I am maybe just implementing incorrectly.

Here are the errors I see.

[ree-1.8.7-2011.03][KraussMac:~/Documents/git_tygerweb/tygerweb]$ guard list
>>>Turn off AMQP/RabbitMQ support...
Authenticating mongo...
/Users/telmate/Documents/git_tygerweb/tygerweb/help/ruby/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:417:in `load_missing_constant': Guard is not missing constant DslDescriber! (ArgumentError)
from /Users/telmate/Documents/git_tygerweb/tygerweb/help/ruby/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:80:in `const_missing'
from /Users/telmate/Documents/git_tygerweb/tygerweb/help/ruby/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:98:in `send'
from /Users/telmate/Documents/git_tygerweb/tygerweb/help/ruby/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:98:in `const_missing'
from /Users/telmate/.rvm/gems/ree-1.8.7-2011.03/gems/guard-0.8.4/lib/guard/cli.rb:86:in `list'
from /Users/telmate/.rvm/gems/ree-1.8.7-2011.03/gems/thor-0.14.6/lib/thor/task.rb:22:in `send'
from /Users/telmate/.rvm/gems/ree-1.8.7-2011.03/gems/thor-0.14.6/lib/thor/task.rb:22:in `run'
from /Users/telmate/.rvm/gems/ree-1.8.7-2011.03/gems/thor-0.14.6/lib/thor/invocation.rb:118:in `invoke_task'
from /Users/telmate/.rvm/gems/ree-1.8.7-2011.03/gems/thor-0.14.6/lib/thor.rb:263:in `dispatch'
from /Users/telmate/.rvm/gems/ree-1.8.7-2011.03/gems/thor-0.14.6/lib/thor/base.rb:389:in `start'
from /Users/telmate/.rvm/gems/ree-1.8.7-2011.03/gems/guard-0.8.4/bin/guard:6
from /Users/telmate/.rvm/gems/ree-1.8.7-2011.03/bin/guard:19:in `load'
from /Users/telmate/.rvm/gems/ree-1.8.7-2011.03/bin/guard:19
[ree-1.8.7-2011.03][KraussMac:~/Documents/git_tygerweb/tygerweb]$ guard -T
>>>Turn off AMQP/RabbitMQ support...
Authenticating mongo...
/Users/telmate/Documents/git_tygerweb/tygerweb/help/ruby/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:417:in `load_missing_constant': Guard is not missing constant DslDescriber! (ArgumentError)
from /Users/telmate/Documents/git_tygerweb/tygerweb/help/ruby/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:80:in `const_missing'
from /Users/telmate/Documents/git_tygerweb/tygerweb/help/ruby/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:98:in `send'
from /Users/telmate/Documents/git_tygerweb/tygerweb/help/ruby/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:98:in `const_missing'
from /Users/telmate/.rvm/gems/ree-1.8.7-2011.03/gems/guard-0.8.4/lib/guard/cli.rb:154:in `show'
from /Users/telmate/.rvm/gems/ree-1.8.7-2011.03/gems/thor-0.14.6/lib/thor/task.rb:22:in `send'
from /Users/telmate/.rvm/gems/ree-1.8.7-2011.03/gems/thor-0.14.6/lib/thor/task.rb:22:in `run'
from /Users/telmate/.rvm/gems/ree-1.8.7-2011.03/gems/thor-0.14.6/lib/thor/invocation.rb:118:in `invoke_task'
from /Users/telmate/.rvm/gems/ree-1.8.7-2011.03/gems/thor-0.14.6/lib/thor.rb:263:in `dispatch'
from /Users/telmate/.rvm/gems/ree-1.8.7-2011.03/gems/thor-0.14.6/lib/thor/base.rb:389:in `start'
from /Users/telmate/.rvm/gems/ree-1.8.7-2011.03/gems/guard-0.8.4/bin/guard:6
from /Users/telmate/.rvm/gems/ree-1.8.7-2011.03/bin/guard:19:in `load'
from /Users/telmate/.rvm/gems/ree-1.8.7-2011.03/bin/guard:19

### Guardfile ###
$rails_rake_task = true
require 'config/boot'
options = { :environment => (ENV['RAILS_ENV'] || "development").dup }
ENV["RAILS_ENV"] = options[:environment]
RAILS_ENV.replace(options[:environment]) if defined?(RAILS_ENV)
require 'config/environment'
require 'util/guards/ftp_guard'

group 'ftp' do
guard 'ftpguard' do
watch(%r{^tmp/facbingham/.+\.txt}){|m| [521, m, "CAI"]}
watch(%r{^tmp/facgoodingjms/.+\.txt}){|m| [1175, m, "CAI"]}
watch(%r{^tmp/caiftp/washington.txt}){|m| [31, m, "CAI"]}
watch(%r{^tmp/owyheeft/.+\.txt}){|m| [74, m, "CAI"]}
watch(%r{^tmp/caiftp/FortHall.txt}){|m| [885, m, "CAI"]}
watch(%r{^tmp/facbingham/.+\.txt}){|m| [1345, m, "CAI"]}
watch(%r{^tmp/facwhitley/inbox/.+\.csv}){|m| [1545, m]}
watch(%r{^tmp/facordes/inbox/.+\.xml}){|m| [1295, m]}
end
end

### util/guards/ftp_guard.rb ###
require 'guard'
require 'guard/guard'
require 'mongoid'
require 'sync/import/integration/jms_integration'

module Guard
class FtpGuard < Guard
def start
puts "Starting FtpGuarding"
end

def stop
puts "Stopping FtpGuarding"
end

def reload
stop
start
end

def run_all
true
end

def choose_fac(path_hash)
fac_id = path_hash[:facility_id]
path = path_hash[:file_name]
vendor = path_hash[:vendor]
case vendor
when "CAI"
require 'sync/import/jms_vendors/vendor_cai'
fork_ftp{
jms_i = JmsIntegration.create(:facility_id => fac_id, :file_name =>path, :file_type =>"txt", :i_type=> "ftp",
:mapping=>VendorCai::TXT_MAP,
:jms_procs => VendorCai::PARSE_BLOCK)
jms_i.save
jms_i.synchronize
}
when "1545"
fork_ftp{
jms_i = JmsIntegration.create(:facility_id => fac_id, :file_name =>path, :file_type =>"csv", :i_type=> "ftp")
#jms_i.synchronize
}
when "1295"
fork_ftp{
jms_i = JmsIntegration.create(:facility_id => fac_id, :file_name =>path, :file_type =>"xml", :i_type=> "ftp")
#jms_i.synchronize
}
else
puts "Hey I am else"
end
end

def run_on_change(paths)
new_paths = []
new_paths << {:facility_id => paths[0], :file_name => paths[1], :vendor=> paths[2]}
new_paths.size == 1 ? choose_fac(new_paths[0]) : new_paths.each do |np| choose_fac(np) end
end

def fork_ftp(&fblock)
fork do
yield fblock
end
end

end
end

Very funny error description.. Guard is not missing constant DslDescriber! Haha if it is not missing then what is the problem lol!
It doesn't effect running my guards as before but I just cannot list my available guards which is somewhat annoying.

Kevin