rails debug - 调试控制台终止应用执行

rails debug - debugging console terminates the app execution

提问人:Meet Makwana 提问时间:11/20/2022 更新时间:11/20/2022 访问量:38

问:

我正在我的 rails6 应用程序中使用,在调试控制台上编写命令时,控制台不会继续应用程序运行状态,而是会终止它,并出现一些我不明白的错误。gem 'debug', '~>1.5.0', '<= 1.6.0'continue

以下是命令行中的错误登录:

[16, 25] in ~/Desktop/app-name/app/controllers/admin/units_controller.rb
    16|     # return redirect_to import_admin_tenant_site_units_path 
    17|     
    18|     # file = File.open(file)
    19|     # csv = CSV.parse(file, headers: true) 
    20|     
=>  21|     binding.b
    22|     
    24|     # CSV.foreach(file, headers: true) do |row|
    25|     #   logger.debug("++++++++Inside.+++++++++")
=>#0    Admin::UnitsController#import at ~/Desktop/app-name/app/controllers/admin/units_controller.rb:21
  #1    ActionController::BasicImplicitRender#send_action(method="import", args=[]) at ~/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/actionpack-6.0.6/lib/action_controller/metal/basic_implicit_render.rb:6
  # and 76 frames (use `bt' command for all frames)
(rdbg) continue    # command
Redirected to http://localhost:3000/admin/tenants/1/sites/1/units/import
Completed 200 OK in 216610ms (ActiveRecord: 2.0ms | Allocations: 139037)


#<Thread:0x000055f9a2607c18@/home/meet/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/paho-mqtt-1.0.12/lib/paho_mqtt/client.rb:130 run> terminated with exception (report_on_exception is true):
Traceback (most recent call last):
        6: from /home/meet/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/paho-mqtt-1.0.12/lib/paho_mqtt/client.rb:134:in `block in daemon_mode'
        5: from /home/meet/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/paho-mqtt-1.0.12/lib/paho_mqtt/client.rb:186:in `mqtt_loop'
        4: from /home/meet/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/paho-mqtt-1.0.12/lib/paho_mqtt/client.rb:190:in `loop_misc'
        3: from /home/meet/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/paho-mqtt-1.0.12/lib/paho_mqtt/connection_helper.rb:151:in `check_keep_alive'
        2: from /home/meet/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/paho-mqtt-1.0.12/lib/paho_mqtt/sender.rb:48:in `send_pingreq'
        1: from /home/meet/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/paho-mqtt-1.0.12/lib/paho_mqtt/sender.rb:36:in `send_packet'
/home/meet/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/paho-mqtt-1.0.12/lib/paho_mqtt/sender.rb:36:in `write': Connection reset by peer (Errno::ECONNRESET)
        6: from /home/meet/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/paho-mqtt-1.0.12/lib/paho_mqtt/client.rb:134:in `block in daemon_mode'
        5: from /home/meet/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/paho-mqtt-1.0.12/lib/paho_mqtt/client.rb:186:in `mqtt_loop'
        4: from /home/meet/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/paho-mqtt-1.0.12/lib/paho_mqtt/client.rb:190:in `loop_misc'
        3: from /home/meet/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/paho-mqtt-1.0.12/lib/paho_mqtt/connection_helper.rb:151:in `check_keep_alive'
        2: from /home/meet/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/paho-mqtt-1.0.12/lib/paho_mqtt/sender.rb:48:in `send_pingreq'
        1: from /home/meet/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/paho-mqtt-1.0.12/lib/paho_mqtt/sender.rb:34:in `send_packet'
/home/meet/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/paho-mqtt-1.0.12/lib/paho_mqtt/sender.rb:41:in `rescue in send_packet': PahoMqtt::WritingException
Exiting
Traceback (most recent call last):
        6: from /home/meet/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/paho-mqtt-1.0.12/lib/paho_mqtt/client.rb:134:in `block in daemon_mode'
        5: from /home/meet/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/paho-mqtt-1.0.12/lib/paho_mqtt/client.rb:186:in `mqtt_loop'
        4: from /home/meet/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/paho-mqtt-1.0.12/lib/paho_mqtt/client.rb:190:in `loop_misc'
        3: from /home/meet/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/paho-mqtt-1.0.12/lib/paho_mqtt/connection_helper.rb:151:in `check_keep_alive'
        2: from /home/meet/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/paho-mqtt-1.0.12/lib/paho_mqtt/sender.rb:48:in `send_pingreq'
        1: from /home/meet/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/paho-mqtt-1.0.12/lib/paho_mqtt/sender.rb:36:in `send_packet'
/home/meet/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/paho-mqtt-1.0.12/lib/paho_mqtt/sender.rb:36:in `write': Connection reset by peer (Errno::ECONNRESET)
        6: from /home/meet/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/paho-mqtt-1.0.12/lib/paho_mqtt/client.rb:134:in `block in daemon_mode'
        5: from /home/meet/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/paho-mqtt-1.0.12/lib/paho_mqtt/client.rb:186:in `mqtt_loop'
        4: from /home/meet/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/paho-mqtt-1.0.12/lib/paho_mqtt/client.rb:190:in `loop_misc'
        3: from /home/meet/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/paho-mqtt-1.0.12/lib/paho_mqtt/connection_helper.rb:151:in `check_keep_alive'
        2: from /home/meet/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/paho-mqtt-1.0.12/lib/paho_mqtt/sender.rb:48:in `send_pingreq'
        1: from /home/meet/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/paho-mqtt-1.0.12/lib/paho_mqtt/sender.rb:34:in `send_packet'
/home/meet/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/paho-mqtt-1.0.12/lib/paho_mqtt/sender.rb:41:in `rescue in send_packet': PahoMqtt::WritingException

我是使用调试控制台和调试包来调试应用程序的新手,我正在遵循这个 youtube 教程,导师使用了这个 gem,我希望我的应用程序继续在命令上执行而不是终止它。continue

Youtube视频链接 - https://youtu.be/EJ8FZMLsVVQ 呵呵。

我的系统是 Ubuntu 20.04 LTS

ruby-on-rails 调试 错误处理

评论


答: 暂无答案