ruby-debug / ruby-debug-ide

An interface which glues ruby-debug to IDEs like Eclipse (RDT), NetBeans and RubyMine.
https://www.jetbrains.com/ruby/features/ruby_debugger.html
Other
370 stars 83 forks source link

Can't run debugger on 1.9.3 #165

Open coding-bunny opened 5 years ago

coding-bunny commented 5 years ago

Can't run the debugger basically with Rubymine in a ruby 1.9.3 project:

/home/olivar/.rbenv/versions/1.9.3-p551/lib/ruby/gems/1.9.1/gems/ruby-debug-ide-0.7.0.beta7/lib/ruby-debug-ide.rb:6:in `require': cannot load such file -- ruby-debug-base19 (LoadError)
    from /home/olivar/.rbenv/versions/1.9.3-p551/lib/ruby/gems/1.9.1/gems/ruby-debug-ide-0.7.0.beta7/lib/ruby-debug-ide.rb:6:in `<top (required)>'
    from /home/olivar/.rbenv/versions/1.9.3-p551/lib/ruby/gems/1.9.1/gems/ruby-debug-ide-0.7.0.beta7/bin/rdebug-ide:8:in `require_relative'
    from /home/olivar/.rbenv/versions/1.9.3-p551/lib/ruby/gems/1.9.1/gems/ruby-debug-ide-0.7.0.beta7/bin/rdebug-ide:8:in `<main>'
mrbiggred commented 5 years ago

I was able to get debugging working with the following Gemfile config:

group :development
  gem 'ruby-debug-ide'
  gem 'ruby-debug-base19x'
end

Notice the x on the end of ruby-debug-base19x. Using other gems such as debase and ruby-debug-base19 didn't work for me.

coding-bunny commented 5 years ago

This returns the following error instead:

Evaluation memory limit is ineffective in JRuby and MRI < 2.0
Fatal exception in DebugThread loop: wrong number of arguments (4 for 3)
Backtrace:
/home/olivar/.rbenv/versions/1.9.3-p551/lib/ruby/gems/1.9.1/gems/ruby-debug-ide-0.6.1/lib/ruby-debug-ide/greeter.rb:13:in `print_greeting_msg'
  from: /home/olivar/.rbenv/versions/1.9.3-p551/lib/ruby/gems/1.9.1/gems/ruby-debug-ide-0.7.0.beta7/lib/ruby-debug-ide.rb:125:in `block (2 levels) in start_control'
  from: /home/olivar/.rbenv/versions/1.9.3-p551/lib/ruby/gems/1.9.1/gems/ruby-debug-ide-0.7.0.beta7/lib/ruby-debug-ide.rb:159:in `notify_dispatcher_if_needed'
  from: /home/olivar/.rbenv/versions/1.9.3-p551/lib/ruby/gems/1.9.1/gems/ruby-debug-ide-0.7.0.beta7/lib/ruby-debug-ide.rb:123:in `block in start_control'
coding-bunny commented 5 years ago

removed and reinstalled the gems using bundler, Rubymine keeps whining that ruby-debug-ide is now not installed.

coding-bunny commented 5 years ago

Only works when I install ruby-debug-ide-0.7.0.beta7 specifcally, and then the above errors happen. Why is Rubymine so intent on this specific version?

mrbiggred commented 5 years ago

@coding-bunny can you post your Gemfile?

coding-bunny commented 5 years ago
source "http://rubygems.org"

gem "active_model_serializers", "~> 0.8.1"
gem "rails",                    "~> 3.2.19"
gem "haml",                     "~> 4.0.0"
gem "formtastic",               "~> 2.2.0"
gem "rest-client",              "~> 1.6.7"
gem "retryable",                "~> 1.3.0"
gem "is_it_working",            "~> 1.0.10"
gem "newrelic_rpm",             "< 4.0"
gem "authority",                "~> 2.5.0"
gem "rollbar"
gem 'oj', '~> 2.16.1' # per Rollbar's setup instructions
gem "mongoid",                  "2.0.2"
gem "bson",                     "1.3.1"
gem "bson_ext",                 "1.3.1"
gem "faraday-http-cache",       "~> 0.4.2"
gem "net-ldap",                 "~> 0.5.1"
gem "whenever",                 "~> 0.9.2"
gem "is_it_up",                 "~> 0.0.2"
gem "dotenv-rails",             "~> 2.0.1"
gem 'lograge'
gem 'circuitbox'

group :assets do
  gem "sass-rails",             "~> 3.2.0"
  gem "coffee-rails",           "~> 3.2.0"
  gem "compass-rails",          "~> 1.1.2"
  gem "font-awesome-rails",     "~> 4.0.3.0"
  gem "uglifier",               "~> 2.3.0"
  gem 'turbo-sprockets-rails3', "~> 0.3.14"
end

group :test do
  gem "shoulda",                "~> 3.5.0"
  gem "shoulda-matchers",       "~> 2.4.0"
  gem "mocha",                  "~> 0.14.0",   require: false
  gem "machinist",              "~> 1.0.6"
  gem "faker",                  "~> 0.9.5"
  gem "machinist_mongo",        "~> 2.0.0.pre"
  gem "vcr",                    "~> 2.7.0"
  gem "webmock",                "~> 1.15.0"
end

group :development do
  gem "pry-rails",              "~> 0.3.2"
  gem "minitest",               "4.7.5"
  gem "guard-minitest",         "2.2.0"
  gem "letter_opener",          "~> 1.2.0"
  gem "puma"
end
mrbiggred commented 5 years ago

I don't see the ruby-debug-ide in your Gemfile. Does this work:

group :development do
  gem 'ruby-debug-ide'
  gem 'ruby-debug-base19x'
  <other gems>
end

I would also recommend removing other debuggers, such as pry.

coding-bunny commented 5 years ago

This works as work-around to get the gem recognised, but it still raises the errors I mentioned above, I had to adjust the source to even get it working. The gems however should work without being in the Gemfile, as Rubymine needs to install and use them. Can't put them permanently in the Gemfile as not everyone uses the same IDE

ViugiNick commented 5 years ago

@coding-bunny Could you please attach the following line right before the failing require (here /home/olivar/.rbenv/versions/1.9.3-p551/lib/ruby/gems/1.9.1/gems/ruby-debug-ide-0.7.0.beta7/lib/ruby-debug-ide.rb:6).

It looks like your problem is very similar to https://youtrack.jetbrains.com/issue/RUBY-23298

P.S. Can you please attach example command line or project.

ViugiNick commented 5 years ago

@coding-bunny Can you please try to uninstall all versions of debase and ruby-debug-base19x and try to install them from RubyMine one more time. But before installing check File | Settings | Languages & Frameworks | Ruby SDK and Gems, to make sure that all versions have been uninstalled.

luke-hill commented 5 years ago

Dependent on your version of RubyMine depends on what versions of the gem auto-install, it's a known bug and I raised it a while ago. The fix is for the teams not to be over-reliant on beta versions and cut legitimate versions, and then release patch fixes if further bugs are eradicated (Adhering better to semver)

See: https://github.com/denofevil/debase/issues/71

I have the issue where I get invalid versions of debase (Which then screws with this gem)

coding-bunny commented 5 years ago

Yeah I like your idea proposed, cause honestly it's causing more of a headache at the moment than it's worth.