# lib/tasks/restart.rake
# enable debugger locally with passenger - also see configuration block in
# config/environments/development.rb
task :restart do
system("touch tmp/restart.txt")
system("touch tmp/debug.txt") if ENV["DEBUG"] == 'true'
end
# config/environments/development.rb
# enable debugging with passenger locally. Also see related rake
# task: lib/tasks/restart.rake
if File.exists?(File.join(RAILS_ROOT,'tmp', 'debug.txt'))
require 'ruby-debug'
Debugger.wait_connection = true
Debugger.start_remote
File.delete(File.join(RAILS_ROOT,'tmp', 'debug.txt'))
end
#
# 1. rake restart DEBUG=true
#
# server will restart with debug enabled
# if you have a breakpoint set, you will notice the web application hanging - waiting for you to connect
#
# 2. connect by doing: rdebug -c