Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

using guard with rspec in rails 6 showing warnings

When running bundle exec guard getting these warnings.

<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'

Its clearly coming from pry gem & too frustrating to see these on all test runs. How can I hide this from showing?

like image 446
Abhilash Avatar asked Dec 28 '19 02:12

Abhilash


1 Answers

This is a known upstream bug in Pry specific to Ruby 2.7. Given Pry hasn't been updated in a while, a suggested fix (which worked for me) is to pull Pry from GitHub:

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

gem 'pry', git: 'https://github.com/pry/pry.git', ref: '272b3290b5250d28ee82a5ff65aa3b29b825e37b'
like image 140
MatzFan Avatar answered Nov 13 '22 06:11

MatzFan