Closed nadeemkhedr closed 10 years ago
Can you try to get the latest version of RVM by rvm get stable
, remove guard-bundler
and guard-rspec
from both your Gemfile
and Guardfile
, and then run bundle exec guard -d -p -i -n f
again? Just make sure it's not caused by other gems.
If the situation doesn't change, please try to modify your local file /home/nadeem/.rvm/gems/ruby-2.1.2@app/gems/guard-rails-0.6.0/lib/guard/rails/runner.rb:55
as @e2 mentioned on guard/guard#653, and run bundle exec guard -d -p -i -n f
.
def pid_file
File.expand_path(options[:pid_file] || File.join(@root, "tmp/pids/#{options[:environment]}.pid"))
rescue
STDERR.puts "ERROR: pid_file failed with: #{$!.inspect} (#{[@root, @options].inspect})"
fail
end
Thank you.
P.S. One thing confused me:
> [#D5BB6C4DB1EE] /home/nadeem/.rvm/gems/ruby-2.1.2@app/gems/guard-rails-0.6.0/lib/guard/rails/runner.rb:55:in `call'
> [#D5BB6C4DB1EE] /home/nadeem/.rvm/gems/ruby-2.1.2@app/gems/guard-rails-0.6.0/lib/guard/rails/runner.rb:55:in `pid_file'
Since there is no block call in pid_file function.
I tested Guard-Rails with 0.6.0 and Guard both 0.6.1 and 0.7.1 on a new Rails project. They both work fine.
@ranmocy - yes, the call
baffled me as well.
Also,
guard/setuper.rb:219:in `block in _setup_signal_traps'
... means Interrupt
was raised (usually through Ctrl-C).
This explains why there's no error in newer versions of Guard (> 2.6.0) (https://github.com/guard/guard/issues/653#issuecomment-61251359) - because it thinks the user pressed Ctrl-C inside the Pry console (which does nothing when the console isn't active).
If that was not due to the user pressing Ctr-C, then to catch it we'd have to try:
def pid_file
File.expand_path(options[:pid_file] || File.join(@root, "tmp/pids/#{options[:environment]}.pid"))
rescue Exception
STDERR.puts "ERROR: pid_file failed: #{$!.inspect} (#{[@root, @options].inspect}), backtrace: \n\t#{$@.join("\n\t")}"
fail
end
Also, since pid_file
is not memiozed, it's called many times in remove_pid_file_and_wait_for_no_pid
(I think it's worth patching this).
So it's statistically likely that pressing Ctrl-C will cause the above error almost every time (and this might explain the call
- it' might be Ruby's internal block or exception handler, I'm not sure).
@nadeemkhedr - did you press Ctrl-C yourself while Rails was loading?
@e2 nope I didn't , i'll try now everything above and post the result
@ranmocy I updated rvm & removed guard-spec & guard-bundler, didn't fix
when i am putting the print in the rescue block its not being called (I tried changing other code in the same file and the changes works so I am modifying the right file)
There is another issue when i run guard
there are two different error callstack that could happen (randomly)
One of them is the one I posted and the other is this one
13:13:23 - INFO - Guard is using NotifySend to send notifications.
13:13:23 - INFO - Guard is using Tmux to send notifications.
13:13:23 - INFO - Guard is using TerminalTitle to send notifications.
13:13:23 - INFO - [Guard::Rails] will start the default web server on port 4040 in development.
13:13:23 - INFO - Starting Rails...
13:13:23 - ERROR - Guard::Rails failed to achieve its <start>, exception was:
> [#D105EDBAA349] ThreadError: can't be called from trap context
> [#D105EDBAA349] /home/nadeem/.rvm/gems/ruby-2.1.2@app/gems/guard-2.6.1/lib/guard/commander.rb:105:in `synchronize'
> [#D105EDBAA349] /home/nadeem/.rvm/gems/ruby-2.1.2@app/gems/guard-2.6.1/lib/guard/commander.rb:105:in `within_preserved_state'
> [#D105EDBAA349] /home/nadeem/.rvm/gems/ruby-2.1.2@app/gems/guard-2.6.1/lib/guard/commander.rb:39:in `stop'
> [#D105EDBAA349] /home/nadeem/.rvm/gems/ruby-2.1.2@app/gems/guard-2.6.1/lib/guard/setuper.rb:219:in `block in _setup_signal_traps'
> [#D105EDBAA349] /home/nadeem/.rvm/gems/ruby-2.1.2@app/gems/guard-rails-0.6.0/lib/guard/rails/runner.rb:117:in `call'
> [#D105EDBAA349] /home/nadeem/.rvm/gems/ruby-2.1.2@app/gems/guard-rails-0.6.0/lib/guard/rails/runner.rb:117:in `has_pid?'
> [#D105EDBAA349] /home/nadeem/.rvm/gems/ruby-2.1.2@app/gems/guard-rails-0.6.0/lib/guard/rails/runner.rb:148:in `block in wait_for_no_pid'
> [#D105EDBAA349] /home/nadeem/.rvm/gems/ruby-2.1.2@app/gems/guard-rails-0.6.0/lib/guard/rails/runner.rb:160:in `wait_for_pid_loop'
> [#D105EDBAA349] /home/nadeem/.rvm/gems/ruby-2.1.2@app/gems/guard-rails-0.6.0/lib/guard/rails/runner.rb:148:in `wait_for_no_pid'
> [#D105EDBAA349] /home/nadeem/.rvm/gems/ruby-2.1.2@app/gems/guard-rails-0.6.0/lib/guard/rails/runner.rb:24:in `stop'
> [#D105EDBAA349] /home/nadeem/.rvm/gems/ruby-2.1.2@app/gems/guard-rails-0.6.0/lib/guard/rails/runner.rb:33:in `restart'
> [#D105EDBAA349] /home/nadeem/.rvm/gems/ruby-2.1.2@app/gems/guard-rails-0.6.0/lib/guard/rails.rb:44:in `reload'
> [#D105EDBAA349] /home/nadeem/.rvm/gems/ruby-2.1.2@app/gems/guard-rails-0.6.0/lib/guard/rails.rb:37:in `start'
> [#D105EDBAA349] /home/nadeem/.rvm/gems/ruby-2.1.2@app/gems/guard-2.6.1/lib/guard/runner.rb:74:in `block in run_supervised_task'
> [#D105EDBAA349] /home/nadeem/.rvm/gems/ruby-2.1.2@app/gems/guard-2.6.1/lib/guard/runner.rb:71:in `catch'
> [#D105EDBAA349] /home/nadeem/.rvm/gems/ruby-2.1.2@app/gems/guard-2.6.1/lib/guard/runner.rb:71:in `run_supervised_task'
> [#D105EDBAA349] /home/nadeem/.rvm/gems/ruby-2.1.2@app/gems/guard-2.6.1/lib/guard/runner.rb:22:in `block (2 levels) in run'
> [#D105EDBAA349] /home/nadeem/.rvm/gems/ruby-2.1.2@app/gems/guard-2.6.1/lib/guard/runner.rb:150:in `block (3 levels) in _scoped_plugins'
> [#D105EDBAA349] /home/nadeem/.rvm/gems/ruby-2.1.2@app/gems/guard-2.6.1/lib/guard/runner.rb:148:in `each'
> [#D105EDBAA349] /home/nadeem/.rvm/gems/ruby-2.1.2@app/gems/guard-2.6.1/lib/guard/runner.rb:148:in `block (2 levels) in _scoped_plugins'
> [#D105EDBAA349] /home/nadeem/.rvm/gems/ruby-2.1.2@app/gems/guard-2.6.1/lib/guard/runner.rb:147:in `catch'
> [#D105EDBAA349] /home/nadeem/.rvm/gems/ruby-2.1.2@app/gems/guard-2.6.1/lib/guard/runner.rb:147:in `block in _scoped_plugins'
> [#D105EDBAA349] /home/nadeem/.rvm/gems/ruby-2.1.2@app/gems/guard-2.6.1/lib/guard/runner.rb:145:in `each'
> [#D105EDBAA349] /home/nadeem/.rvm/gems/ruby-2.1.2@app/gems/guard-2.6.1/lib/guard/runner.rb:145:in `_scoped_plugins'
> [#D105EDBAA349] /home/nadeem/.rvm/gems/ruby-2.1.2@app/gems/guard-2.6.1/lib/guard/runner.rb:21:in `block in run'
> [#D105EDBAA349] /home/nadeem/.rvm/gems/ruby-2.1.2@app/gems/lumberjack-1.0.9/lib/lumberjack.rb:32:in `unit_of_work'
> [#D105EDBAA349] /home/nadeem/.rvm/gems/ruby-2.1.2@app/gems/guard-2.6.1/lib/guard/runner.rb:20:in `run'
> [#D105EDBAA349] /home/nadeem/.rvm/gems/ruby-2.1.2@app/gems/guard-2.6.1/lib/guard/commander.rb:28:in `block in start'
> [#D105EDBAA349] /home/nadeem/.rvm/gems/ruby-2.1.2@app/gems/guard-2.6.1/lib/guard/commander.rb:108:in `block in within_preserved_state'
> [#D105EDBAA349] /home/nadeem/.rvm/gems/ruby-2.1.2@app/gems/guard-2.6.1/lib/guard/commander.rb:105:in `synchronize'
> [#D105EDBAA349] /home/nadeem/.rvm/gems/ruby-2.1.2@app/gems/guard-2.6.1/lib/guard/commander.rb:105:in `within_preserved_state'
> [#D105EDBAA349] /home/nadeem/.rvm/gems/ruby-2.1.2@app/gems/guard-2.6.1/lib/guard/commander.rb:26:in `start'
> [#D105EDBAA349] /home/nadeem/.rvm/gems/ruby-2.1.2@app/gems/guard-2.6.1/lib/guard/cli.rb:107:in `start'
> [#D105EDBAA349] /home/nadeem/.rvm/gems/ruby-2.1.2@app/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'
> [#D105EDBAA349] /home/nadeem/.rvm/gems/ruby-2.1.2@app/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
> [#D105EDBAA349] /home/nadeem/.rvm/gems/ruby-2.1.2@app/gems/thor-0.19.1/lib/thor.rb:359:in `dispatch'
> [#D105EDBAA349] /home/nadeem/.rvm/gems/ruby-2.1.2@app/gems/thor-0.19.1/lib/thor/base.rb:440:in `start'
> [#D105EDBAA349] /home/nadeem/.rvm/gems/ruby-2.1.2@app/gems/guard-2.6.1/bin/guard:6:in `<top (required)>'
> [#D105EDBAA349] /home/nadeem/.rvm/gems/ruby-2.1.2@app/bin/guard:23:in `load'
> [#D105EDBAA349] /home/nadeem/.rvm/gems/ruby-2.1.2@app/bin/guard:23:in `<main>'
> [#D105EDBAA349] /home/nadeem/.rvm/gems/ruby-2.1.2@app/bin/ruby_executable_hooks:15:in `eval'
> [#D105EDBAA349] /home/nadeem/.rvm/gems/ruby-2.1.2@app/bin/ruby_executable_hooks:15:in `<main>'
13:13:23 - INFO - Guard::Rails has just been fired
13:13:23 - INFO - Guard is now watching at '/home/nadeem/work/app/server'
All my tries I left the modified rescue
code and it never was called
If i did this
def pid_file
STDERR.puts "ERROR: pid_file failed: #{$!.inspect} (#{[@root, @options].inspect})}"
File.expand_path(options[:pid_file] || File.join(@root, "tmp/pids/#{options[:environment]}.pid"))
end
the callstack is:
server [master●] % guard
13:21:05 - INFO - Guard is using NotifySend to send notifications.
13:21:05 - INFO - Guard is using Tmux to send notifications.
13:21:05 - INFO - Guard is using TerminalTitle to send notifications.
13:21:05 - INFO - [Guard::Rails] will start the default web server on port 4040 in development.
13:21:05 - INFO - Starting Rails...
ERROR: pid_file failed: nil (["/home/nadeem/work/app/server", {:CLI=>nil, :daemon=>false, :debugger=>false, :environment=>"development", :force_run=>false, :pid_fil$
=>nil, :port=>4040, :server=>nil, :start_on_start=>true, :timeout=>30, :zeus_plan=>"server", :zeus=>false}])}
ERROR: pid_file failed: nil (["/home/nadeem/work/app/server", {:CLI=>nil, :daemon=>false, :debugger=>false, :environment=>"development", :force_run=>false, :pid_fil$
=>nil, :port=>4040, :server=>nil, :start_on_start=>true, :timeout=>30, :zeus_plan=>"server", :zeus=>false}])}
13:21:05 - ERROR - Guard::Rails failed to achieve its <start>, exception was:
> [#FA49A8F3E7E5] ThreadError: can't be called from trap context
> [#FA49A8F3E7E5] /home/nadeem/.rvm/gems/ruby-2.1.2@app/gems/guard-2.6.1/lib/guard/commander.rb:105:in `synchronize'
> [#FA49A8F3E7E5] /home/nadeem/.rvm/gems/ruby-2.1.2@app/gems/guard-2.6.1/lib/guard/commander.rb:105:in `within_preserved_state'
> [#FA49A8F3E7E5] /home/nadeem/.rvm/gems/ruby-2.1.2@app/gems/guard-2.6.1/lib/guard/commander.rb:39:in `stop'
> [#FA49A8F3E7E5] /home/nadeem/.rvm/gems/ruby-2.1.2@app/gems/guard-2.6.1/lib/guard/setuper.rb:219:in `block in _setup_signal_traps'
> [#FA49A8F3E7E5] /home/nadeem/.rvm/gems/ruby-2.1.2@app/gems/guard-rails-0.6.0/lib/guard/rails/runner.rb:55:in `call'
> [#FA49A8F3E7E5] /home/nadeem/.rvm/gems/ruby-2.1.2@app/gems/guard-rails-0.6.0/lib/guard/rails/runner.rb:55:in `inspect'
> [#FA49A8F3E7E5] /home/nadeem/.rvm/gems/ruby-2.1.2@app/gems/guard-rails-0.6.0/lib/guard/rails/runner.rb:55:in `pid_file'
> [#FA49A8F3E7E5] /home/nadeem/.rvm/gems/ruby-2.1.2@app/gems/guard-rails-0.6.0/lib/guard/rails/runner.rb:115:in `has_pid?'
> [#FA49A8F3E7E5] /home/nadeem/.rvm/gems/ruby-2.1.2@app/gems/guard-rails-0.6.0/lib/guard/rails/runner.rb:146:in `block in wait_for_no_pid'
> [#FA49A8F3E7E5] /home/nadeem/.rvm/gems/ruby-2.1.2@app/gems/guard-rails-0.6.0/lib/guard/rails/runner.rb:158:in `wait_for_pid_loop'
> [#FA49A8F3E7E5] /home/nadeem/.rvm/gems/ruby-2.1.2@app/gems/guard-rails-0.6.0/lib/guard/rails/runner.rb:146:in `wait_for_no_pid'
> [#FA49A8F3E7E5] /home/nadeem/.rvm/gems/ruby-2.1.2@app/gems/guard-rails-0.6.0/lib/guard/rails/runner.rb:24:in `stop'
> [#FA49A8F3E7E5] /home/nadeem/.rvm/gems/ruby-2.1.2@app/gems/guard-rails-0.6.0/lib/guard/rails/runner.rb:33:in `restart'
> [#FA49A8F3E7E5] /home/nadeem/.rvm/gems/ruby-2.1.2@app/gems/guard-rails-0.6.0/lib/guard/rails.rb:44:in `reload'
> [#FA49A8F3E7E5] /home/nadeem/.rvm/gems/ruby-2.1.2@app/gems/guard-rails-0.6.0/lib/guard/rails.rb:37:in `start'
> [#FA49A8F3E7E5] /home/nadeem/.rvm/gems/ruby-2.1.2@app/gems/guard-2.6.1/lib/guard/runner.rb:74:in `block in run_supervised_task'
> [#FA49A8F3E7E5] /home/nadeem/.rvm/gems/ruby-2.1.2@app/gems/guard-2.6.1/lib/guard/runner.rb:71:in `catch'
> [#FA49A8F3E7E5] /home/nadeem/.rvm/gems/ruby-2.1.2@app/gems/guard-2.6.1/lib/guard/runner.rb:71:in `run_supervised_task'
> [#FA49A8F3E7E5] /home/nadeem/.rvm/gems/ruby-2.1.2@app/gems/guard-2.6.1/lib/guard/runner.rb:22:in `block (2 levels) in run'
> [#FA49A8F3E7E5] /home/nadeem/.rvm/gems/ruby-2.1.2@app/gems/guard-2.6.1/lib/guard/runner.rb:150:in `block (3 levels) in _scoped_plugins'
> [#FA49A8F3E7E5] /home/nadeem/.rvm/gems/ruby-2.1.2@app/gems/guard-2.6.1/lib/guard/runner.rb:148:in `each'
> [#FA49A8F3E7E5] /home/nadeem/.rvm/gems/ruby-2.1.2@app/gems/guard-2.6.1/lib/guard/runner.rb:148:in `block (2 levels) in _scoped_plugins'
> [#FA49A8F3E7E5] /home/nadeem/.rvm/gems/ruby-2.1.2@app/gems/guard-2.6.1/lib/guard/runner.rb:147:in `catch'
> [#FA49A8F3E7E5] /home/nadeem/.rvm/gems/ruby-2.1.2@app/gems/guard-2.6.1/lib/guard/runner.rb:147:in `block in _scoped_plugins'
> [#FA49A8F3E7E5] /home/nadeem/.rvm/gems/ruby-2.1.2@app/gems/guard-2.6.1/lib/guard/runner.rb:145:in `each'
> [#FA49A8F3E7E5] /home/nadeem/.rvm/gems/ruby-2.1.2@app/gems/guard-2.6.1/lib/guard/runner.rb:145:in `_scoped_plugins'
> [#FA49A8F3E7E5] /home/nadeem/.rvm/gems/ruby-2.1.2@app/gems/guard-2.6.1/lib/guard/runner.rb:21:in `block in run'
> [#FA49A8F3E7E5] /home/nadeem/.rvm/gems/ruby-2.1.2@app/gems/lumberjack-1.0.9/lib/lumberjack.rb:32:in `unit_of_work'
> [#FA49A8F3E7E5] /home/nadeem/.rvm/gems/ruby-2.1.2@app/gems/guard-2.6.1/lib/guard/runner.rb:20:in `run'
> [#FA49A8F3E7E5] /home/nadeem/.rvm/gems/ruby-2.1.2@app/gems/guard-2.6.1/lib/guard/commander.rb:28:in `block in start'
> [#FA49A8F3E7E5] /home/nadeem/.rvm/gems/ruby-2.1.2@app/gems/guard-2.6.1/lib/guard/commander.rb:108:in `block in within_preserved_state'
> [#FA49A8F3E7E5] /home/nadeem/.rvm/gems/ruby-2.1.2@app/gems/guard-2.6.1/lib/guard/commander.rb:105:in `synchronize'
> [#FA49A8F3E7E5] /home/nadeem/.rvm/gems/ruby-2.1.2@app/gems/guard-2.6.1/lib/guard/commander.rb:105:in `within_preserved_state'
> [#FA49A8F3E7E5] /home/nadeem/.rvm/gems/ruby-2.1.2@app/gems/guard-2.6.1/lib/guard/commander.rb:26:in `start'
> [#FA49A8F3E7E5] /home/nadeem/.rvm/gems/ruby-2.1.2@app/gems/guard-2.6.1/lib/guard/cli.rb:107:in `start'
> [#FA49A8F3E7E5] /home/nadeem/.rvm/gems/ruby-2.1.2@app/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'
> [#FA49A8F3E7E5] /home/nadeem/.rvm/gems/ruby-2.1.2@app/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
> [#FA49A8F3E7E5] /home/nadeem/.rvm/gems/ruby-2.1.2@app/gems/thor-0.19.1/lib/thor.rb:359:in `dispatch'
> [#FA49A8F3E7E5] /home/nadeem/.rvm/gems/ruby-2.1.2@app/gems/thor-0.19.1/lib/thor/base.rb:440:in `start'
> [#FA49A8F3E7E5] /home/nadeem/.rvm/gems/ruby-2.1.2@app/gems/guard-2.6.1/bin/guard:6:in `<top (required)>'
> [#FA49A8F3E7E5] /home/nadeem/.rvm/gems/ruby-2.1.2@app/bin/guard:23:in `load'
> [#FA49A8F3E7E5] /home/nadeem/.rvm/gems/ruby-2.1.2@app/bin/guard:23:in `<main>'
> [#FA49A8F3E7E5] /home/nadeem/.rvm/gems/ruby-2.1.2@app/bin/ruby_executable_hooks:15:in `eval'
> [#FA49A8F3E7E5] /home/nadeem/.rvm/gems/ruby-2.1.2@app/bin/ruby_executable_hooks:15:in `<main>'
13:21:05 - INFO - Guard::Rails has just been fired
13:21:05 - INFO - Guard is now watching at '/home/nadeem/work/app/server'
Looks like guard-rails is somehow interrupting itself:
https://github.com/ranmocy/guard-rails/blob/master/lib/guard/rails/runner.rb#L24
The question is: why is the pid of the ruby/guard process the same as that of the Rails instance?
You could try adding a line to the stop() method:
def stop
if has_pid?
pid = File.read(pid_file).strip.to_i
STDERR.puts "STOPPING: #{pid} (file: #{pid_file}) from process: #{$$}"
sig_sent = kill_process("INT", pid)
wait_for_no_pid if sig_sent
# If you lost your pid_file, you are already died.
kill_process("KILL", pid)
remove_pid_file_and_wait_for_no_pid
end
end
Output
STOPPING: 0 (file: /home/nadeem/work/app/server/tmp/pids/development.pid) from process: 3229
Full stacktrace
14:18:07 - INFO - Guard is using NotifySend to send notifications.
14:18:07 - INFO - Guard is using Tmux to send notifications.
14:18:07 - INFO - Guard is using TerminalTitle to send notifications.
14:18:07 - INFO - [Guard::Rails] will start the default web server on port 4040 in development.
14:18:07 - INFO - Starting Rails...
STOPPING: 0 (file: /home/nadeem/work/app/server/tmp/pids/development.pid) from process: 3229 [4/13]
14:18:07 - ERROR - Guard::Rails failed to achieve its <start>, exception was:
> [#F1BAFF26B88E] ThreadError: can't be called from trap context
> [#F1BAFF26B88E] /home/nadeem/.rvm/gems/ruby-2.1.2@app/gems/guard-2.6.1/lib/guard/commander.rb:105:in `synchronize'
> [#F1BAFF26B88E] /home/nadeem/.rvm/gems/ruby-2.1.2@app/gems/guard-2.6.1/lib/guard/commander.rb:105:in `within_preserved_state'
> [#F1BAFF26B88E] /home/nadeem/.rvm/gems/ruby-2.1.2@app/gems/guard-2.6.1/lib/guard/commander.rb:39:in `stop'
> [#F1BAFF26B88E] /home/nadeem/.rvm/gems/ruby-2.1.2@app/gems/guard-2.6.1/lib/guard/setuper.rb:219:in `block in _setup_signal_traps'
> [#F1BAFF26B88E] /home/nadeem/.rvm/gems/ruby-2.1.2@app/gems/guard-rails-0.6.0/lib/guard/rails/runner.rb:56:in `call'
> [#F1BAFF26B88E] /home/nadeem/.rvm/gems/ruby-2.1.2@app/gems/guard-rails-0.6.0/lib/guard/rails/runner.rb:56:in `pid_file'
> [#F1BAFF26B88E] /home/nadeem/.rvm/gems/ruby-2.1.2@app/gems/guard-rails-0.6.0/lib/guard/rails/runner.rb:115:in `has_pid?'
> [#F1BAFF26B88E] /home/nadeem/.rvm/gems/ruby-2.1.2@app/gems/guard-rails-0.6.0/lib/guard/rails/runner.rb:146:in `block in wait_for_no_pid'
> [#F1BAFF26B88E] /home/nadeem/.rvm/gems/ruby-2.1.2@app/gems/guard-rails-0.6.0/lib/guard/rails/runner.rb:158:in `wait_for_pid_loop'
> [#F1BAFF26B88E] /home/nadeem/.rvm/gems/ruby-2.1.2@app/gems/guard-rails-0.6.0/lib/guard/rails/runner.rb:146:in `wait_for_no_pid'
> [#F1BAFF26B88E] /home/nadeem/.rvm/gems/ruby-2.1.2@app/gems/guard-rails-0.6.0/lib/guard/rails/runner.rb:25:in `stop'
> [#F1BAFF26B88E] /home/nadeem/.rvm/gems/ruby-2.1.2@app/gems/guard-rails-0.6.0/lib/guard/rails/runner.rb:34:in `restart'
> [#F1BAFF26B88E] /home/nadeem/.rvm/gems/ruby-2.1.2@app/gems/guard-rails-0.6.0/lib/guard/rails.rb:44:in `reload'
> [#F1BAFF26B88E] /home/nadeem/.rvm/gems/ruby-2.1.2@app/gems/guard-rails-0.6.0/lib/guard/rails.rb:37:in `start'
> [#F1BAFF26B88E] /home/nadeem/.rvm/gems/ruby-2.1.2@app/gems/guard-2.6.1/lib/guard/runner.rb:74:in `block in run_supervised_task'
> [#F1BAFF26B88E] /home/nadeem/.rvm/gems/ruby-2.1.2@app/gems/guard-2.6.1/lib/guard/runner.rb:71:in `catch'
> [#F1BAFF26B88E] /home/nadeem/.rvm/gems/ruby-2.1.2@app/gems/guard-2.6.1/lib/guard/runner.rb:71:in `run_supervised_task'
> [#F1BAFF26B88E] /home/nadeem/.rvm/gems/ruby-2.1.2@app/gems/guard-2.6.1/lib/guard/runner.rb:22:in `block (2 levels) in run'
> [#F1BAFF26B88E] /home/nadeem/.rvm/gems/ruby-2.1.2@app/gems/guard-2.6.1/lib/guard/runner.rb:150:in `block (3 levels) in _scoped_plugins'
> [#F1BAFF26B88E] /home/nadeem/.rvm/gems/ruby-2.1.2@app/gems/guard-2.6.1/lib/guard/runner.rb:148:in `each'
> [#F1BAFF26B88E] /home/nadeem/.rvm/gems/ruby-2.1.2@app/gems/guard-2.6.1/lib/guard/runner.rb:148:in `block (2 levels) in _scoped_plugins'
> [#F1BAFF26B88E] /home/nadeem/.rvm/gems/ruby-2.1.2@app/gems/guard-2.6.1/lib/guard/runner.rb:147:in `catch'
> [#F1BAFF26B88E] /home/nadeem/.rvm/gems/ruby-2.1.2@app/gems/guard-2.6.1/lib/guard/runner.rb:147:in `block in _scoped_plugins'
> [#F1BAFF26B88E] /home/nadeem/.rvm/gems/ruby-2.1.2@app/gems/guard-2.6.1/lib/guard/runner.rb:145:in `each'
> [#F1BAFF26B88E] /home/nadeem/.rvm/gems/ruby-2.1.2@app/gems/guard-2.6.1/lib/guard/runner.rb:145:in `_scoped_plugins'
> [#F1BAFF26B88E] /home/nadeem/.rvm/gems/ruby-2.1.2@app/gems/guard-2.6.1/lib/guard/runner.rb:21:in `block in run'
> [#F1BAFF26B88E] /home/nadeem/.rvm/gems/ruby-2.1.2@app/gems/lumberjack-1.0.9/lib/lumberjack.rb:32:in `unit_of_work'
> [#F1BAFF26B88E] /home/nadeem/.rvm/gems/ruby-2.1.2@app/gems/guard-2.6.1/lib/guard/runner.rb:20:in `run'
> [#F1BAFF26B88E] /home/nadeem/.rvm/gems/ruby-2.1.2@app/gems/guard-2.6.1/lib/guard/commander.rb:28:in `block in start'
> [#F1BAFF26B88E] /home/nadeem/.rvm/gems/ruby-2.1.2@app/gems/guard-2.6.1/lib/guard/commander.rb:108:in `block in within_preserved_state'
> [#F1BAFF26B88E] /home/nadeem/.rvm/gems/ruby-2.1.2@app/gems/guard-2.6.1/lib/guard/commander.rb:105:in `synchronize'
> [#F1BAFF26B88E] /home/nadeem/.rvm/gems/ruby-2.1.2@app/gems/guard-2.6.1/lib/guard/commander.rb:105:in `within_preserved_state'
> [#F1BAFF26B88E] /home/nadeem/.rvm/gems/ruby-2.1.2@app/gems/guard-2.6.1/lib/guard/commander.rb:26:in `start'
> [#F1BAFF26B88E] /home/nadeem/.rvm/gems/ruby-2.1.2@app/gems/guard-2.6.1/lib/guard/cli.rb:107:in `start'
> [#F1BAFF26B88E] /home/nadeem/.rvm/gems/ruby-2.1.2@app/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'
> [#F1BAFF26B88E] /home/nadeem/.rvm/gems/ruby-2.1.2@app/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
> [#F1BAFF26B88E] /home/nadeem/.rvm/gems/ruby-2.1.2@app/gems/thor-0.19.1/lib/thor.rb:359:in `dispatch'
> [#F1BAFF26B88E] /home/nadeem/.rvm/gems/ruby-2.1.2@app/gems/thor-0.19.1/lib/thor/base.rb:440:in `start'
> [#F1BAFF26B88E] /home/nadeem/.rvm/gems/ruby-2.1.2@app/gems/guard-2.6.1/bin/guard:6:in `<top (required)>'
> [#F1BAFF26B88E] /home/nadeem/.rvm/gems/ruby-2.1.2@app/bin/guard:23:in `load'
> [#F1BAFF26B88E] /home/nadeem/.rvm/gems/ruby-2.1.2@app/bin/guard:23:in `<main>'
> [#F1BAFF26B88E] /home/nadeem/.rvm/gems/ruby-2.1.2@app/bin/ruby_executable_hooks:15:in `eval'
> [#F1BAFF26B88E] /home/nadeem/.rvm/gems/ruby-2.1.2@app/bin/ruby_executable_hooks:15:in `<main>'
14:18:07 - INFO - Guard::Rails has just been fired
14:18:07 - INFO - Guard is now watching at '/home/nadeem/work/app/server'
check your pid file: /home/nadeem/work/app/server/tmp/pids/development.pid
, because I'm guessing it's empty ...
How to reproduce: just create an empty tmp/pids/development.pid
@e2 actually there is an empty development.pid there :(
EDIT: it worked after i deleted it , have any clue why that happened ? (it was an empty development.pid)
Many thanks guys for solving my problem, now everything is working
@nadeemkhedr - thanks for the detailed reports and for poking around!
Thanks guys for pointing out the problem and the pull request from @e2 !
@ranmocy - you're welcome :)
I originally posted an issue on the
guard
project but I guess the issue is fromguard-rails
https://github.com/guard/guard/issues/653The stack trace from running
guard
. (This suddenly happened today, this setup was working for 2+ months)GuardFile
Gemfile.lock