这是我的代码:
# please_just_work.rb
require 'bundler/setup'
Bundler.require
byebug
puts "a = #{a}"
在 byebug 会话中,我设置了 的值a
,但它仍未定义:
[1, 5] in /home/paper/tmp/debug.rb
1: require 'bundler/setup'
2: Bundler.require
3:
4: byebug
=> 5: puts "a = #{a}"
(byebug) a = 1
1
(byebug) continue
Traceback (most recent call last):
please_just_work.rb:5:in `<main>': undefined local variable or method `a' for main:Object (NameError)
我正在运行 Ubuntu 18.04