Instantly share code, notes, and snippets.

What would you like to do?
How to Ruby Debug with Pow

How to Ruby Debug with Pow

Below are steps I followed to get ruby debugger ruby-debug running with Pow. Based on info from this thread and this blog post

1) Update your Gemfile

Assuming you're writing your app in Ruby 1.9 and using Bundler, just add the dependency to your development gems:

group :development do
  gem 'ruby-debug19', require: 'ruby-debug'

2) Update development environment

Add the following to config/environments/development.rb

# Always run remote debugger in development mode.
require 'ruby-debug'
Debugger.settings[:autoeval] = true
puts "=> Debugger enabled"

3) In terminal connect to RDebug’s server with:

rdebug -c

4) Update your code with debugger interrupt call

def create
  @post = Post.find(params[:post_id])
  @comment = @post.comments.create(params[:comment])
  redirect_to post_path(@post)



This comment has been minimized.

Copy link

ma11hew28 commented Jul 30, 2011

Nice, thanks! I also had to do gem install ruby-debug19


This comment has been minimized.

Copy link

shamil614 commented Aug 15, 2012

Works for me. Just what I needed. As an FYI for anybody else using Rails 3.2 you can just use gem 'debugger', :require => 'debugger' in Bundler.


This comment has been minimized.

Copy link

chuckbergeron commented Dec 6, 2012

Worked like a charm! Thanks for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment