Unable to debug in RubyMine 4.5 using Ruby 1.9.3
UPDATE: RubyMine 6+ supports debugger gem.
Make sure to remove gem 'debugger'
from your Gemfile
, it's a known conflict that will break debugging from RubyMine. You need only 2 gems related to debugger, exactly as stated in my another answer linked in your question.
After removing the gem you need to ensure it's not referenced anywhere in the project. In this particular case r_spec_runner.rb
had require 'ruby-debug'
statement causing cannot load such file -- ruby-debug
error when trying to run rails console
.
Trying to debug ruby 1.9.3p194 rails 3.2.7
Even though this question duplicates two other questions here, I'll answer it for the sake of completeness.
In order to debug from RubyMine you must use only 2 debug gems:
ruby-debug-base19x
ruby-debug-ide
Exactly these gems must be used, not ruby-debug-base19
, not ruby-debug19
, not debugger
. All the other debug gems must be uninstalled and removed from the Gemfile
.
See this answer for the details how to install proper debug gem versions. If you have a problem downloading linecache19-0.5.13.gem
gem, try this mirror instead.
Verify with gem list
that you have the following or more recent versions installed:
ruby-debug-base19x (0.11.30.pre10)
ruby-debug-ide (0.4.17.beta9)
No other debug gems should be listed by this command.
As stated in another answer, debugger
gem must not be used, it will conflict with the debug gems used by RubyMine and debugger will not work. You must uninstall this gem, remove it from the Gemfile
and ensure that your code doesn't call any methods from this gem and is not trying to load it.
Happy debugging!
As suggested by @Anjan, your Gemfile
for debugging can look like this:
gem 'linecache19', '>= 0.5.13', :git => 'https://github.com/robmathews/linecache19-0.5.13.git'
gem 'ruby-debug-base19x', '>= 0.11.30.pre10'
gem 'ruby-debug-ide', '>= 0.4.17.beta14'`
Just run bundle install
to get the proper versions of the required debug gems.
debugging a rails app with rubymine
You have ruby-debug
gem installed, remove it.
See this answer, only 2 debug gems are needed (versions will be different for Ruby 1.8):
ruby-debug-base (0.10.5.rc3)
ruby-debug-ide (0.4.17.beta16)
linecache19 with ruby 1.9.3-p194 and rvm
Something was amiss when I tried to curl
the gem. When I visited the rubyforge site and downloaded the gem manually, everything worked.
cannot load such file -- script/rails : Getting this error while remote debugging through RubyMine
You are using some weird debug gems, only the following are needed:
ruby-debug-base19x
ruby-debug-ide
First, remove all the ruby-debug*
gems, then install the required gems using the following commands:
gem install ruby-debug-base19x --pre
gem install ruby-debug-ide --pre
You should get the following (or newer) versions:
ruby-debug-base19x (0.11.30.pre10)
ruby-debug-ide (0.4.17.beta9)
Adjust your Gemfile
to include only these two gems (except the app specific gems).
If you are getting linecache19
related errors, install it as follows:
curl -OL http://rubyforge.org/frs/download.php/75414/linecache19-0.5.13.gem
gem install linecache19-0.5.13.gem
@Anjan has contributed the complete Gemfile changes for debugging:
gem 'linecache19', '>= 0.5.13', :git => 'https://github.com/robmathews/linecache19-0.5.13.git'
gem 'ruby-debug-base19x', '>= 0.11.30.pre10'
gem 'ruby-debug-ide', '>= 0.4.17.beta14'
Don't forget to update the bundle.
Connecting to Debugger timeout error in RubyMine
In case of the weird issues possibly caused by networking rebooting the system may help.
Related Topics
How to Set Default Ruby Version with Rvm
How to Install the Ruby Ri Documentation
"Stack Level Too Deep" Running Rake Db:Create:All
Installing Cocoapods: No Response
What Does 'If _File_ == $0' Mean in Ruby
How to Pass an Argument to Array.Map Short Cut
Ruby on Rails: How to Edit Database.Yml for Postgresql
Activerecord - Querying Polymorphic Associations
How to Configure Ruby on Rails with Oracle
Rails Route to Username Instead of Id
How to Automate Chrome Request Blocking Using Selenium-Webdriver for Ruby
Differencebetween 'Range#Include' and 'Range#Cover'
How to Run a Single Test in Minitest
Error Installing Nokogiri: Failed to Build Gem Native Extension & Libiconv Is Missing (Osx)