5

I have started using RubyMine 6. I am working on a Rails 4, Ruby 2.1.1 project. I am not able to find how to debug into RubyMine with Pow as a server.

Can you please point me to the right direction?

halfer
  • 19,824
  • 17
  • 99
  • 186
Moon
  • 33,439
  • 20
  • 81
  • 132

2 Answers2

15

I am able to debug from RubyMine using the remote debugging. I'm using RubyMine 6, Rails 3, Ruby 2.1.1.

  1. First create a .powenv file and add:

    export RUBY_DEBUG_PORT=1234

    export POW_WORKERS=1

  2. Add the following gems to your Gemfile:

    gem 'ruby-debug-ide'

    gem 'debase'

  3. Create a new initializer start_debugger.rb and add the following content:

    if ENV['RUBY_DEBUG_PORT']
      require 'ruby-debug-ide'
      Debugger.start_server nil, ENV['RUBY_DEBUG_PORT'].to_i
    end
    
  4. Now in RubyMine you should be able to add a new run configuration using the default template for Ruby remote debug setting the local and remote folders to the root of your Rails app.

  5. Now restart pow and attempt to connect. You should see it connected in the debugger pane.
Ron Warholic
  • 9,994
  • 31
  • 47
  • 4
    Fantastic answer. This works really well. I'd like to point out for step 4 that you also have to set both the local and remote ports to 1234. One of the ports has a different default, so it didn't work for me at first. – Steven Hirlston Apr 25 '15 at 15:05
4

Actually, you can just use Pow to proxy yourapp.dev domain to your localhost:3000 by

echo 3000 > ~/.pow/yourapp

And then, access yourapp.dev and debug your app in Rubymine as normal

Zach
  • 41
  • 2