Found an article Passenger (mod_rails) for development. Now with debugger!. Like it - I use debugger a lot. Added some automation to start rdebug
lib/tasks/adhoc/restart.rake
namespace :phusion do
desc 'Restart phusion'
task :restart do
system("touch tmp/restart.txt")
if ENV["DEBUG"] == 'true'
system("touch tmp/debug.txt")
attach_debugger
end
end
end
def attach_debugger
if RUBY_PLATFORM =~ /linux/
shell_helper = File.join(RAILS_ROOT,'lib','tasks','adhoc','attach_debugger.sh')
if ENV['DISPLAY']
system("xterm -e '#{shell_helper}'")
system("touch tmp/restart.txt")
else
exec shell_helper
end
end
end
lib/tasks/adhoc/attach_debugger.sh>
#!/bin/sh while true; do rdebug -c 2>/dev/null if [ "$?" == "0" ]; then break fi sleep 1 done