Issue when trying to debug Rails App

已回答

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

 

0

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

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

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

0

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

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

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

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

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

0

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

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

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

0

actioncable (6.0.0, 6.0.0.rc1)
actionmailbox (6.0.0, 6.0.0.rc1)
actionmailer (6.0.0, 6.0.0.rc1)
actionpack (6.0.0, 6.0.0.rc1)
actiontext (6.0.0, 6.0.0.rc1)
actionview (6.0.0, 6.0.0.rc1)
active_admin_import (4.1.1)
active_hash (3.0.0, 2.2.1)
activeadmin (2.4.0, 2.3.1, 2.2.0)
activejob (6.0.0, 6.0.0.rc1)
activemodel (6.0.0, 6.0.0.rc1)
activerecord (6.0.0, 6.0.0.rc1)
activerecord-import (1.0.2, 0.28.2)
activestorage (6.0.0, 6.0.0.rc1)
activesupport (6.0.0, 6.0.0.rc1)
addressable (2.7.0, 2.6.0)
arbre (1.2.1)
ast (2.4.0)
audited (4.9.0)
babel-source (5.8.35)
babel-transpiler (0.7.0)
backport (1.1.2)
bcrypt (3.1.13)
benchmark-malloc (0.1.0)
benchmark-perf (0.5.0)
benchmark-trend (0.3.0)
bigdecimal (default: 1.4.1)
bindex (0.8.1)
bootsnap (1.4.5, 1.4.4)
brakeman (4.7.1, 4.7.0, 4.6.1, 4.5.1)
builder (3.2.3)
bullet (6.0.2, 6.0.1)
bundler (2.0.2, default: 1.17.2)
bundler-audit (0.6.1)
byebug (11.0.1)
capitalize-names (1.0.6)
capybara (3.29.0, 3.25.0)
childprocess (3.0.0, 2.0.0, 1.0.1)
cmath (default: 1.0.0)
coderay (1.1.2)
concurrent-ruby (1.1.5)
connection_pool (2.2.2)
crack (0.4.3)
crass (1.0.5, 1.0.4)
csv (default: 3.0.9)
database_cleaner (1.7.0)
date (default: 2.0.0)
dbm (default: 1.0.0)
debase (0.3.0.beta8, 0.2.4.1)
debase-ruby_core_source (0.10.5)
devise (4.7.1)
did_you_mean (1.3.0)
diff-lcs (1.3)
docile (1.3.2)
dotenv (2.7.5, 2.7.4)
dotenv-rails (2.7.5, 2.7.4)
e2mmap (default: 0.1.0)
erubi (1.9.0, 1.8.0)
et-orbi (1.2.2, 1.2.1)
etc (default: 1.0.1)
execjs (2.7.0)
factory_bot (5.1.1, 5.1.0, 5.0.2)
factory_bot_rails (5.1.1, 5.1.0, 5.0.2)
faker (2.6.0, 2.5.0, 2.4.0, 1.9.6)
faraday (0.17.0, 0.16.2, 0.15.4)
faraday_middleware (0.13.1)
fcntl (default: 1.0.0)
ffi (1.11.1)
fiddle (default: 1.0.0)
fileutils (default: 1.1.0)
foreman (0.85.0)
formtastic (3.1.5)
formtastic_i18n (0.6.0)
forwardable (default: 1.2.0)
fugit (1.3.3, 1.3.1)
fuubar (2.4.1)
gdbm (default: 2.0.0)
geocoder (1.5.2, 1.5.1)
globalid (0.4.2)
graphiql-rails (1.7.0)
graphql (1.9.14, 1.9.12, 1.9.7)
graphql-errors (0.3.0)
has_scope (0.7.2)
hashdiff (1.0.0, 0.4.0)
hashie (3.6.0)
htmlentities (4.3.4)
i18n (1.7.0, 1.6.0)
inherited_resources (1.11.0)
io-console (default: 0.4.7)
ipaddr (default: 1.2.2)
irb (default: 1.0.0)
jaro_winkler (1.5.3)
jbuilder (2.9.1)
jquery-rails (4.3.5)
json (2.2.0, default: 2.1.0)
jwt (2.2.1)
kaminari (1.1.1)
kaminari-actionview (1.1.1)
kaminari-activerecord (1.1.1)
kaminari-core (1.1.1)
kiba (2.5.0)
listen (3.1.5)
logger (default: 1.3.0)
loofah (2.3.1, 2.3.0, 2.2.3)
mail (2.7.1)
marcel (0.3.3)
matrix (default: 0.1.0)
method_source (0.9.2)
mimemagic (0.3.3)
mini_mime (1.0.2)
mini_portile2 (2.4.0)
minitest (5.12.2, 5.12.0, 5.11.3)
msgpack (1.3.1, 1.3.0)
multipart-post (2.1.1)
mutex_m (default: 0.1.0)
net-telnet (0.2.0)
newrelic_rpm (6.7.0.359, 6.6.0.358, 6.5.0.357)
nio4r (2.5.2, 2.4.0)
nokogiri (1.10.4)
openssl (default: 2.1.2)
orm_adapter (0.5.0)
ostruct (default: 0.1.0)
parallel (1.18.0, 1.17.0)
parser (2.6.5.0, 2.6.4.1, 2.6.3.0)
pg (1.1.4)
pg_search (2.3.0)
polyamorous (2.3.0)
power_assert (1.1.3)
prime (default: 0.1.0)
pry (0.12.2)
pry-byebug (3.7.0)
psych (default: 3.1.0)
public_suffix (4.0.1, 3.1.1)
puma (3.12.1)
raabro (1.1.6)
rack (2.0.7)
rack-cors (1.0.3)
rack-protection (2.0.7, 2.0.5)
rack-proxy (0.6.5)
rack-test (1.1.0)
rails (6.0.0, 6.0.0.rc1)
rails-dom-testing (2.0.3)
rails-html-sanitizer (1.3.0, 1.2.0, 1.0.4)
rails_12factor (0.0.3)
rails_serve_static_assets (0.0.5)
rails_stdout_logging (0.0.5)
railties (6.0.0, 6.0.0.rc1)
rainbow (3.0.0)
rake (13.0.0, 12.3.3, 12.3.2)
ransack (2.3.0)
rb-fsevent (0.10.3)
rb-inotify (0.10.0)
rchardet (1.8.0)
rdoc (default: 6.1.0)
redis (4.1.3, 4.1.2)
regexp_parser (1.6.0, 1.5.1)
responders (3.0.0)
restforce (4.0.0, 3.1.0)
reverse_markdown (1.3.0)
rexml (default: 3.1.9)
rgeo (2.1.1, 2.0.1)
rgeo-activerecord (6.2.1)
rspec (3.9.0, 3.8.0)
rspec-benchmark (0.5.1, 0.5.0)
rspec-core (3.9.0, 3.8.2)
rspec-expectations (3.9.0, 3.8.5, 3.8.4)
rspec-mocks (3.9.0, 3.8.2, 3.8.1)
rspec-rails (3.9.0, 3.8.2)
rspec-support (3.9.0, 3.8.3, 3.8.2)
rspec_junit_formatter (0.4.1)
rss (default: 0.2.7)
rubocop (0.75.1, 0.75.0, 0.74.0, 0.72.0)
rubocop-performance (1.5.0, 1.4.1, 1.4.0)
rubocop-rails (2.3.2, 2.2.0)
rubocop-rspec (1.36.0, 1.33.0)
ruby-debug-ide (0.8.0.beta8, 0.7.0)
ruby-progressbar (1.10.1)
ruby_dep (1.5.0)
rubyzip (2.0.0, 1.3.0, 1.2.3)
safe_yaml (1.0.5)
sass (3.7.4)
sass-listen (4.0.0)
sass-rails (5.1.0)
sassc (2.2.1, 2.2.0)
sassc-rails (2.1.2)
scanf (default: 1.0.0)
sdbm (default: 1.0.0)
search_object (1.2.3)
search_object_graphql (0.3)
selenium-webdriver (3.142.6, 3.142.5, 3.142.4, 3.142.3)
sentry-raven (2.12.0, 2.11.3, 2.11.0)
shell (default: 0.7)
shoulda-matchers (4.1.2, 4.1.0)
sidekiq (6.0.2, 6.0.1, 6.0.0, 5.2.7)
sidekiq-cron (1.1.0)
simplecov (0.17.1, 0.17.0)
simplecov-cobertura (1.3.1)
simplecov-html (0.10.2)
smarter_csv (1.2.6)
solargraph (0.37.2)
spring (2.1.0)
spring-watcher-listen (2.0.1)
sprockets (4.0.0, 3.7.2)
sprockets-es6 (0.9.2)
sprockets-rails (3.2.1)
sqlite3 (1.4.1)
stringio (default: 0.0.2)
strscan (default: 1.0.0)
sync (default: 0.5.0)
test-unit (3.2.9)
thor (0.20.3, 0.19.4)
thread_safe (0.3.6)
thwait (default: 0.1.0)
tilt (2.0.10, 2.0.9)
timecop (0.9.1)
tracer (default: 0.1.0)
turbolinks (5.2.1)
turbolinks-source (5.2.0)
tzinfo (1.2.5)
unicode-display_width (1.6.0)
uniform_notifier (1.13.0, 1.12.1)
warden (1.2.8)
web-console (4.0.1)
webdrivers (4.1.2)
webmock (3.7.6, 3.7.5, 3.6.0)
webpacker (4.0.7)
webrick (default: 1.4.2)
websocket-driver (0.7.1)
websocket-extensions (0.1.4)
xmlrpc (0.3.0)
xpath (3.2.0)
yard (0.9.20)
zeitwerk (2.2.0, 2.1.10, 2.1.8)
zlib (default: 1.0.0)

0

I have same issue.

RubyMine 2019.2.4
Build #RM-192.7142.37, built on October 29, 2019
Runtime version: 11.0.4+10-b304.77 x86_64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
macOS 10.15.1
GC: ParNew, ConcurrentMarkSweep
Memory: 725M
Cores: 16
Registry: ide.mac.allowDarkWindowDecorations=true, debugger.watches.in.variables=false
Non-Bundled Plugins: Railways, SnakeYAML plugin, YAML/Ansible support, com.alayouni.ansiHighlight, com.bryansharpe.slackstorm, com.intellij.ideolog, com.microsoft.vso.idea, com.paperetto.dash, com.ultrahob.zerolength.plugin, name.kropp.intellij.makefile, net.seesharpsoft.intellij.plugins.csv, org.elixir_lang, org.jetbrains.plugins.localization, izhangzhihao.rainbow.brackets, org.jetbrains.plugins.vue, ru.adelf.idea.dotenv

ruby-2.6.5

Switching off ```ruby.use.experimental.debugger``` helps. 

0

> Switching off ```ruby.use.experimental.debugger``` helps. 

This fixed it for me too.

That's an item under the Actions tab in the quick file access popup, where you can enable and disable experimental features.

0

请先登录再写评论。