运行bundle exec guard
时收到这些警告。
<main>:1: warning: __FILE__ in eval may not return location in binding; use Binding#source_location instead
/home/workstation/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/pry-0.12.2/lib/pry/commands/whereami.rb:40: warning: in `eval'
<main>:1: warning: __LINE__ in eval may not return location in binding; use Binding#source_location instead
/home/workstation/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/pry-0.12.2/lib/pry/commands/whereami.rb:41: warning: in `eval'
<main>:1: warning: __FILE__ in eval may not return location in binding; use Binding#source_location instead
/home/workstation/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/pry-0.12.2/lib/pry/method/weird_method_locator.rb:88: warning: in `eval'
<main>:1: warning: __FILE__ in eval may not return location in binding; use Binding#source_location instead
/home/workstation/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/pry-0.12.2/lib/pry/method/weird_method_locator.rb:80: warning: in `eval'
它显然来自撬宝石,实在令人沮丧,无法在所有测试中都看到它们。如何隐藏此内容?
这是特定于Ruby 2.7的Pry中的已知上游bug。鉴于Pry已有一段时间没有更新,建议的修复方法(对我有用)是从GitHub拉Pry:
# Gemfile
source 'https://rubygems.org'
gem 'pry', git: 'https://github.com/pry/pry.git', ref: '272b3290b5250d28ee82a5ff65aa3b29b825e37b'