Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Debugging in RubyMine with Pow as a server - Ruby 2.1.1 + Rails 4

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?

like image 605
Moon Avatar asked Jul 26 '14 13:07

Moon


1 Answers

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.
like image 198
Ron Warholic Avatar answered Sep 21 '22 22:09

Ron Warholic