Skip to content

NoMethodError: undefined method 'Pathname' for ShopifyAPI::GraphQL:Module #1385

@idler921

Description

@idler921

Issue summary

Before opening this issue, I have:

  • Upgraded to the latest version of the package
    • shopify_api version: 9.5.2 the latest version before 10 released on January 06, 2025
    • Ruby version: ruby 3.1.2p20 from debian, tried fedora's ruby 3.4.2
    • Operating system: debian 12 (docker latest)
  • Set log_level: :debug in my configuration, if applicable
  • Found a reliable way to reproduce the problem that indicates it's a problem with the package
  • Looked for similar issues in this repository
  • Checked that this isn't an issue with a Shopify API

I'm encountering a NoMethodError: undefined method 'Pathname' for ShopifyAPI::GraphQL:Module when trying to require 'shopify_api' in IRB. This happens immediately after installing the gem in a clean Debian environment.

Steps to Reproduce:

  1. docker run -it debian /bin/bash
  2. apt update
  3. apt install -y --no-install-recommends build-essential ruby-full ruby-dev gem bundler git curl
  4. gem install shopify_api -v "<10"
  5. irb
  6. require 'shopify_api'

Expected Behavior:

The shopify_api gem should load without errors.

Actual Behavior:

I receive the following error:

irb(main):001:0> require 'shopify_api'
/var/lib/gems/3.1.0/gems/shopify_api-9.5.2/lib/shopify_api/graphql.rb:7:in `<module:GraphQL>': undefined method `Pathname' for ShopifyAPI::GraphQL:Module (NoMethodError)
                                                                                      
    DEFAULT_SCHEMA_LOCATION_PATH = Pathname('shopify_graphql_schemas')                
                                   ^^^^^^^^                                           
        from /var/lib/gems/3.1.0/gems/shopify_api-9.5.2/lib/shopify_api/graphql.rb:6:in `<module:ShopifyAPI>'
        from /var/lib/gems/3.1.0/gems/shopify_api-9.5.2/lib/shopify_api/graphql.rb:5:in `<top (required)>'
        from <internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from <internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from /var/lib/gems/3.1.0/gems/shopify_api-9.5.2/lib/shopify_api.rb:31:in `<module:ShopifyAPI>'
        from /var/lib/gems/3.1.0/gems/shopify_api-9.5.2/lib/shopify_api.rb:14:in `<top (required)>'
        from <internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb>:160:in `require'
        from <internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb>:160:in `rescue in require'
        from <internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb>:149:in `require'
        from (irb):1:in `<main>'                                                      
        from /usr/lib/ruby/gems/3.1.0/gems/irb-1.4.1/exe/irb:11:in `<top (required)>' 
	from /usr/bin/irb:25:in `load'
	from /usr/bin/irb:25:in `<main>'
<internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb>:85:in `require': cannot load such file -- shopify_api (LoadError)
	from <internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb>:85:in `require'
	from (irb):1:in `<main>'
	from /usr/lib/ruby/gems/3.1.0/gems/irb-1.4.1/exe/irb:11:in `<top (required)>'
	from /usr/bin/irb:25:in `load'
	from /usr/bin/irb:25:in `<main>'

I have tried multiple combination version of graphql from latest <2 to 2.5.x and graphql-client 0.18 to 0.26, pathname from 0.2 to 0.4, but none of them seems works. I have a working environment in macos ruby 3.2.2 with gem list output:

.....
shopify_api (9.5.1, 9.5)
activesupport (7.0.6, 6.1.4.3)
pathname (default: 0.2.1)
graphql (2.0.24, 1.13.1)
graphql-client (0.18.0, 0.17.0)
.....

I have just updated the dev server from fedora 40 to 42 and trigger that error, so try to use a clean debian docker and able to be reproduced. It may have some potential imcompatibility with graphql or other dependent library.

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