2

I am really hoping someone can help with this as it is driving me mad.

I am trying to get Debugging up and running in RubyMine on Ubuntu and just having no luck at all. I have spent hours Googling and reading articles, trying different things with no joy.

All that happens when I run in debug mode is the following message comes up:

Fast Debugger (ruby-debug-ide 0.6.0, debase 0.2.1, file filtering is supported) listens on 127.0.0.1:56580

Then I get a loading bar that says waiting 10 seconds for Debugger. Then I get:

Process finished with exit code 143

I am at a loss of what to try, I have been struggling to even find a decent article about how to configure from scratch, i just get a lot of rather vague articles from RubyMine.

Is there any particular gems that are best to use (or even required) for debugging.

I am using Rails 4 and Ruby 2.2.1. I am pretty new to Ruby which is making the process much harder, but more important that I get it working!!

Many thanks David

EDIT

Here is my gemfile:

source 'https://rubygems.org'


# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.2.4'
# Use postgresql as the database for Active Record
gem 'pg'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.1.0'
# See https://github.com/rails/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby

# Use jquery as the JavaScript library
gem 'jquery-rails'
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.0'
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', '~> 0.4.0', group: :doc

# add user authentication
gem 'devise'
gem 'omniauth'
gem 'omniauth-google-oauth2'

# add geo location
gem 'geokit'
gem 'geokit-rails', github: 'geokit/geokit-rails'

# add friendly id for sef URLS
gem 'friendly_id'

# add image uploader
gem 'carrierwave'
gem 'rmagick'

# for sass grid system
gem 'sass-rails'
gem 'compass-rails', git: 'https://github.com/Compass/compass-rails', branch: 'master'
gem 'susy'

# require js
gem 'requirejs-rails'

# load pagination module
gem 'will_paginate'

# allow adding of meta tags and descriptions to pages
gem 'meta-tags'

group :development, :test do
  # Call 'byebug' anywhere in the code to stop execution and get a debugger console
 # gem 'byebug'
  gem 'rspec-rails'
  gem 'factory_girl_rails'
end

group :development do
  # Access an IRB console on exception pages or by using <%= console %> in views
  gem 'web-console', '~> 2.0'

  # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
  gem 'spring'
end

group :test do
  gem 'faker'
  gem 'capybara'
  gem 'guard-rspec'
  gem 'launchy'
end

I have tried manually adding Debugger gem, rails-debugger-ui but with no joy so I took them out temporarily. I did have byebug in there which I have commented out because RubyMine complained the first time I tried to debug with it on and I am not really using it anyway, it is just something I added from a tutorial I started but haven't got round to finishing yet.

Many thanks for your help all.

Edit 2

I created a new project through RubyMine (before I did it through command line) and have done a simple test looping through an array for numbers in a controller and it has worked!! This time, the first time I ran the project it said it needed to install something which I said yes to, it didnt do this with my exising project before but the problem is I have no idea what it did. I have run a bundle show against both projects to see if it added any gems but I cannot see anything obvious. :

link to a diff, on the right is the test that does work, on the left is the one that doesnt

Any thoughts of what to try? Im reluctant to start a new project and move everything over into it if I can possibly help it.

Many thanks again

Edit 3

Many thanks for all the help.In the end I decided just to copy everything into a new project that I created through RubyMine itself rather than through terminal and that solved it.

Edit 4

I think I finally have everything working. After re-creating new projects over and over and copying my code back in line by line, the only difference I can find with what is working to the rest is that I am now running it from a folder that isn't being watched by Dropbox, I don't know how or why this would of affected it but it is the only explanation I can find.

Many thanks for all the help I have received

Dave Essery
  • 207
  • 1
  • 12
  • Are you using Unicorn? – Mihai Dinculescu Sep 07 '15 at 10:34
  • Do you have byebug gem in your gemfile? – Mauddev Sep 07 '15 at 11:11
  • Just post your `gemfile` Dave :) – Mihai Dinculescu Sep 07 '15 at 11:16
  • Thanks all @Mihai-AndreiDinculescu - No not using Unicorn. Gem file added in edit. – Dave Essery Sep 07 '15 at 11:36
  • @Mauddev - Did have byebug in there but I took it out as I wasnt using it and RubyMine complained about it when i first tried to debug – Dave Essery Sep 07 '15 at 11:37
  • Try to create a new Rails project and check if debug is working in it. This will at least assure you that there's nothing wrong with your env, and that only that one project acts funny. – Mihai Dinculescu Sep 07 '15 at 11:49
  • @Mihai-AndreiDinculescu - Thanks, that worked!! I am not sure what to try next now though, see my edit. Thanks again!! – Dave Essery Sep 07 '15 at 12:08
  • RubyMine is automatically adding the `ruby-debug-base` and `ruby-debug-ide` gems. That's OK. I would suggest to try and debug your debug issue. There first step would be to copy the contents of the previos `gemfile` over to the new project. – Mihai Dinculescu Sep 07 '15 at 12:14
  • PS: you should should not have the `pry` gem. Like `byebug`, `pry` is used for console debugging. – Mihai Dinculescu Sep 07 '15 at 12:15
  • @Mihai-AndreiDinculescu - I just copied everything into a new project and it is working now. I think in future I will create all projects through RubyMine itself. Thank you so much for your help!! Also interesting side now, RubyMine automatically adds byebug to new projects for some reason so I just removed it myself. – Dave Essery Sep 07 '15 at 12:48
  • That shouldn't be an issue. I have managed in the past to debug in RubyMine projects created with `rails new`. My guess is that you were unlucky and hit an undocumented quirk in RubyMine. I will compile an answer with possible debug scenarios. – Mihai Dinculescu Sep 07 '15 at 12:58
  • There's one more thing you can try in your old project, `bundle clean --force` and `bundle install`. – Mihai Dinculescu Sep 07 '15 at 13:04

2 Answers2

1

More often than now, RubyMine debugger will be able to configure itself on the first run.

It is however advisable to manually remove the console debuggers (pry, byebug, etc.) prior to running the RubyMine debugger.

Usually you do not have to add any extra configuration yourself. The special cases which actually require extra configuration can be found here.

If after cleaning your gemfile RubyMine still doesn't work, try removing the unused gems in the project by force.

`bundle clean --force`
`bundle install`

As a last resort scenario, create a new project and try the debugger in it to make sure that nothing funny is happening to your environment. If this works fine, try copy your gemfile contents over and later on code, step by step.

Mihai Dinculescu
  • 19,743
  • 8
  • 55
  • 70
  • After taking a quick break for lunch and coming back to it, I started getting a new error. The debug server would spin up but whenever I added a breakpoint, the server stopped with an error 'Process finished with exit code 1'. At this point i thought I would just try a reboot to see what happens, after that I am right back to square 1, cannot even launch a debug server anymore. I have stripped back my gem file to the same as the test project I created (that still works), run your clean and install commands but still no joy :( – Dave Essery Sep 07 '15 at 13:58
  • I just deleted my .idea folder and re-opened the project. I can now start a server again but I still get the same error whenever I set a breakpoint. Thanks again!! – Dave Essery Sep 07 '15 at 14:09
1

I had the same issue. Check your project's path for not-alphanumeric characters.

In my case the project was in the folder Me&Myself. After changing it to MeAndMyself it worked as expected.

I'm still trying to figure out the exact culprit to report the issue.

Delian
  • 56
  • 4