ruby-on-rails - 使用 RubyMine 调试 Rails 5:断点不起作用
问题描述
我刚刚安装了最新的 RubyMine (2018.1.1),并使用 RubyMine 中的向导创建了一个 Rails 5.2 应用程序。然后我生成了一个脚手架,以便我可以进行一些测试。
如果我在单元测试中设置断点,则断点有效。但是,如果我运行 Web 服务器(我都尝试了 - 默认 Puma 和 WEBrick),则没有断点工作。我可以从我的控制器中看到打印语句,但从未触发断点。
我究竟做错了什么?
这是我的宝石清单:
actioncable (5.2.0)
actionmailer (5.2.0)
actionpack (5.2.0)
actionview (5.2.0)
activejob (5.2.0)
activemodel (5.2.0)
activerecord (5.2.0)
activestorage (5.2.0)
activesupport (5.2.0)
addressable (2.5.2)
archive-zip (0.11.0)
arel (9.0.0)
bigdecimal (default: 1.3.4)
bindex (0.5.0)
bootsnap (1.3.0)
builder (3.2.3)
bundler (1.16.1)
byebug (10.0.2)
capybara (3.0.3)
childprocess (0.9.0)
chromedriver-helper (1.2.0)
cmath (default: 1.0.0)
coffee-rails (4.2.2)
coffee-script (2.4.1)
coffee-script-source (1.12.2)
concurrent-ruby (1.0.5)
crass (1.0.4)
csv (default: 1.0.0)
date (default: 1.0.0)
debase (0.2.2)
debase-ruby_core_source (0.10.3)
erubi (1.7.1)
etc (default: 1.0.0)
execjs (2.7.0)
fcntl (default: 1.0.0)
ffi (1.9.23)
fiddle (default: 1.0.0)
fileutils (default: 1.0.2)
globalid (0.4.1)
i18n (1.0.1)
io-console (default: 0.4.6)
io-like (0.3.0)
ipaddr (default: 1.2.0)
jbuilder (2.7.0)
json (default: 2.1.0)
listen (3.1.5)
loofah (2.2.2)
mail (2.7.0)
marcel (0.3.2)
method_source (0.9.0)
mimemagic (0.3.2)
mini_mime (1.0.0)
mini_portile2 (2.3.0)
minitest (5.11.3)
msgpack (1.2.4)
multi_json (1.13.1)
nio4r (2.3.0)
nokogiri (1.8.2)
openssl (default: 2.1.0)
psych (default: 3.0.2)
public_suffix (3.0.2)
puma (3.11.4)
rack (2.0.5)
rack-test (1.0.0)
rails (5.2.0)
rails-dom-testing (2.0.3)
rails-html-sanitizer (1.0.4)
railties (5.2.0)
rake (12.3.1)
rb-fsevent (0.10.3)
rb-inotify (0.9.10)
rdoc (default: 6.0.1)
ruby-debug-ide (0.7.0.beta4)
ruby_dep (1.5.0)
rubyzip (1.2.1)
sass (3.5.6)
sass-listen (4.0.0)
sass-rails (5.0.7)
scanf (default: 1.0.0)
sdbm (default: 1.0.0)
selenium-webdriver (3.11.0)
spring (2.0.2)
spring-watcher-listen (2.0.1)
sprockets (3.7.1)
sprockets-rails (3.2.1)
sqlite3 (1.3.13)
stringio (default: 0.0.1)
strscan (default: 1.0.0)
thor (0.20.0)
thread_safe (0.3.6)
tilt (2.0.8)
turbolinks (5.1.1)
turbolinks-source (5.1.0)
tzinfo (1.2.5)
uglifier (4.1.10)
web-console (3.6.2)
webrick (default: 1.4.2)
websocket-driver (0.7.0)
websocket-extensions (0.1.3)
xpath (3.0.0)
zlib (default: 1.0.0)
我在用ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-linux]
解决方案
这个问题记录在这里:https ://youtrack.jetbrains.com/issue/RUBY-20684
还指定了一种解决方法: comment bootsnap requiring in the Gemfile and in the boot.rb
注释掉bootsnap
对我有用——断点现在可以工作了。
推荐阅读
- ruby-on-rails - 纱线测试以检测 rails vue 应用程序中的编译时错误
- spring - 任务“:compileKotlin”执行失败
- java - 无法将实时数据库中的数据检索到 recyclerView
- c++ - 在 QWidget::paintEvent 上获取未缩放的绘制设备(忽略 devicePixelRatio)
- java - Spring Boot MVC 中 SSE 上的单播消息
- excel - 形状透明度出错了
- java - 查找要从 hashmap1 添加/删除的键和值等于 hashmap2
- browser - Google oauth 首次阻止弹出窗口导致“内容安全策略指令 script-src 包含无效源:严格动态”
- javascript - 无法拉取 Github 依赖项
- ruby-on-rails - 为什么 app 初始化后 object_id 会发生变化?