Skip to content

measured-3.2.1 is incompatible with json > 3.0.0 #192

Description

@bou-oub-dev

When booting a Rails application with measured-3.2.1 and json-3.0.1, I get the following error:

gems/json-3.0.1/lib/json/common.rb:302:in 'JSON::Ext::Parser.parse':
unexpected token '//' at line 1 column 1 (JSON::ParserError)

The issue appears to be caused by the JSON cache files shipped with measured, such as length.json. These files contain // comments at the beginning.

Starting with json 3.0.0, the JSON parser became stricter and no longer accepts // comments, resulting in a JSON::ParserError.

A workaround is to explicitly pin/downgrade the json gem to a version below 3.0.0, since json is also installed as a dependency of several other gems.

For future releases of measured, the // comments should be removed from the JSON cache files so that they contain valid JSON and remain compatible with newer versions of the json gem.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions