Issue when trying to debug Rails App

Answered

I'm still very new to Ruby/Rails so forgive me if this is something obvious (I've googled but can't seem to find anything that helps).  When I run my app under RubyMine, everything works fine, no issues.  When I try to "Debug", my app crashes from what can only guess that it's not loading resources the same way as it does when running.  I receive this error:

Uncaught exception: uninitialized constant Temp::RevenovaId

This is hit in a file that is using ActiveAdmin, it's trying to register the class Temp::RevenovaId but I'm assuming it's not loaded so it blows up with the constant error message.  I've tried adding a require to the top of this class, it errors out by saying it can't load this file.  I've tried running RubyMine under sudo, still the same issue.

I've tried disabling/enabling Spring under the Debugging Preferences, still does not work.

I have set breakpoints further up the chain (for instance in the development.rb file) and these breakpoints are hit, but when I let the app continue to run it blows up at that same point.

I'm not understanding why it runs fine without the debugger, and even in production, but when I run under the debugger it does not work.

Any help provided would be greatly appreciated!

Thank you so much!

Tom

 

12 comments
Comment actions Permalink

Hello Tom,

could you please specify your RubyMine version? There've been a similar issue already fixed in 2019.3 EAP so in case you haven't tried it please do.

0
Comment actions Permalink

Hi, 

Thanks for the quick response, here is what I have in RubyMine->About

RubyMine 2019.2.4
Build #RM-192.7142.37, built on October 29, 2019

You have a perpetual fallback license for this version
Subscription is active until October 29, 2020
Runtime version: 11.0.4+10-b304.77 x86_64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
macOS 10.14.6
GC: ParNew, ConcurrentMarkSweep
Memory: 1979M
Cores: 16
Registry:
Non-Bundled Plugins: com.intellij.lang.jsgraphql, training

0
Comment actions Permalink

I just tried the EAP 2019.3 version, still same behavior.   Any other ideas?  Thank you!

0
Comment actions Permalink

Another update, I ended up adding a require with the full path to the file at the top of the class that was getting the uninitialized constant error, that solved that issue, but then another class had the same issue.  I kept adding "requires" up until it started giving me the same issues outside of my code, it was throwing these errors in the gems code.  It seems like it's not resolving class names to file names correctly.  

 

If you have any other ideas please let me know.

 

Thanks

0
Comment actions Permalink

Good news, 

I searched a bit more and found this issue:  

https://youtrack.jetbrains.com/issue/RUBY-24781?_ga=2.143426614.2080926865.1573043561-550608582.1569350449&_gac=1.191698136.1569591563.Cj0KCQjw5rbsBRCFARIsAGEYRwdKOpE_q_YyJ75OzE_G8x273KnQQcBw2Z6TkvRBBmvOLzKWLKDji5waArYqEALw_wcB

 

Turning off experimental debugging did the trick.  I"m working !  Thanks

 

******

yes, you can press Ctrl+Shift+A (Go to Action), find Experimental features and turn off ruby.use.experimental.debugger

*****

0
Comment actions Permalink

The issue you're referring to is indeed similar to yours but it has been fixed and it should be fine in the last 2019.3 EAP. Could you please specify which debug gems version were being used when you tried 2019.3 EAP?

0
Comment actions Permalink

Is this what you are looking for?  I just re-installed it and tried to debug from a fresh install, it fails (I didn't turn off the experimental feature).  

 

Fast Debugger (ruby-debug-ide 0.8.0.beta8, debase 0.3.0.beta8

 

The one that is working for me is:  Fast Debugger (ruby-debug-ide 0.7.0, debase 0.2.4.1,

0
Comment actions Permalink

These gems' versions aren't the latest ones. What is your 2019.3 EAP build?

0
Comment actions Permalink

Those were the ones that RM grabbed when I attempted to debug, build info here:

 

RubyMine 2019.3 EAP
Build #RM-193.4932.17, built on October 31, 2019
RubyMine EAP User
Expiration date: November 30, 2019
Runtime version: 11.0.4+10-b520.2 x86_64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
macOS 10.14.6
GC: ParNew, ConcurrentMarkSweep
Memory: 1979M
Cores: 16
Registry:
Non-Bundled Plugins: com.intellij.lang.jsgraphql, training

0
Comment actions Permalink

Which Ruby version are you using? The last versions of debug gems in that EAP are ruby-debug-ide 0.8.0.beta17, debase 0.3.0.beta17

0
Comment actions Permalink

Could you please attach the output of `gem list` command for that Ruby SDK?

0

Please sign in to leave a comment.