gpt4 book ai didi

ruby-on-rails - 在 rails 6 中使用带有 rspec 的防护显示警告

转载 作者:行者123 更新时间:2023-12-03 16:37:51 25 4
gpt4 key购买 nike

运行时 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'

它显然来自 pry gem 并且在所有测试运行中看到这些都太令人沮丧了。我怎样才能隐藏这个不显示?

最佳答案

这是一个已知的上游 bug在特定于 Ruby 2.7 的 Pry 中。鉴于 Pry 有一段时间没有更新,建议的修复(对我有用)是从 GitHub 中提取 Pry:

# Gemfile
source 'https://rubygems.org'

gem 'pry', git: 'https://github.com/pry/pry.git', ref: '272b3290b5250d28ee82a5ff65aa3b29b825e37b'

关于ruby-on-rails - 在 rails 6 中使用带有 rspec 的防护显示警告,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59507672/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com