Cannot Load Such File - Script/Rails: Getting This Error While Remote Debugging Through Rubymine

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.

RubyMine 7 Remote Debug No such file or directory error

I figured out the problem.
You need to add a mapping for your local project root -> remote project root. You can add that in debug configurations.
It solved problem for me.

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)

How do I Remote Debug with RubyMine?

Could you please describe the steps what you did exactly at RubyMine's official support forum?
Here it is: http://devnet.jetbrains.net/community/ruby?view=discussions&start=0

Regards,
Oleg

rdebug-ide is exploading is my rdebug-ide incantation wrong?

Solution found:

So this line in the original tutorial is incorrect

rdebug-ide --host 0.0.0.0 --port 4000 --dispatcher-port 26162 -- $COMMAND$

In that it fails to explain what exactly you should replace, or for that matter that you even have to replace, $COMMAND$ with. Upon many teeth grinding machinations and running permutations of my own I discovered a working solution.

rdebug-ide --port 1236 --dispatcher-port 26166 --host 0.0.0.0 -- script/rails s -b 0.0.0.0


Related Topics



Leave a reply



Submit