Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Noisy warning from Parser (AutoInstrument) #286

Closed
cschneid opened this issue Sep 26, 2019 · 5 comments
Closed

Noisy warning from Parser (AutoInstrument) #286

cschneid opened this issue Sep 26, 2019 · 5 comments

Comments

@cschneid
Copy link
Contributor

Seen on APM itself. When the parser library loads to do AutoInstruments, it warns if the patch version of Ruby doesn't match what it expects.

There are dozens of warnings like this emitted during a deploy.

The warnings don't seem to cause problems, just noise. It'd be nice to quiet them.

      01 warning: parser/current is loading parser/ruby24, which recognizes
      01 warning: 2.4.7-compliant syntax, but you are running 2.4.5.
      01 warning: please see https://github.com/whitequark/parser#compatibility-with-ruby-mri.
@ioquatix
Copy link
Contributor

I wonder if we can do this upstream.

@jonekdahl
Copy link

The author of Parser has publicly stated that the warning is not going away. What you could do is offer instructions on how to make sure that you have a version of Parser that matches your Ruby version, which I believe involves upgrading either one or locking the versions to a known good combination (we're using ruby '2.6.5' and gem 'parser', '~> 2.6.5.0' in the Gemfile of our app).

@ioquatix
Copy link
Contributor

ioquatix commented Nov 1, 2019

@jonekdahl can you link us to this declaration?

@jonekdahl
Copy link

@ioquatix This is the comment I was thinking about: rubocop/rubocop#1819 (comment)

@dlanderson
Copy link
Contributor

The solution here is to make sure the parser gem is set to the correct version for the version of ruby that's running. Another option is to use a gem which can be configured to ignore the warnings, like in this example:

# config/initializers/warning_ignores.rb

### https://github.com/jeremyevans/ruby-warning

Warning.ignore(/warning: parser/)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants