jnbt / candy_check

Check and verify in-app receipts
MIT License
126 stars 70 forks source link

Error with google-api-client (0.36.4) #44

Closed Nerian closed 4 years ago

Nerian commented 4 years ago

Using

I get an error merely trying to get rails to start. Seems like this gem is not requiring the google-api-client gem correctly.

Any workaround?

cannot load such file -- google/api_client (LoadError)
$ rails c
Traceback (most recent call last):
bin/rails: Bootsnap::LoadPathCache::FallbackScan
    56: from bin/rails:4:in `<main>'
    55: from /Users/Nerian/.rvm/gems/ruby-2.6.5/gems/activesupport-6.0.2.1/lib/active_support/dependencies.rb:325:in `require'
    54: from /Users/Nerian/.rvm/gems/ruby-2.6.5/gems/activesupport-6.0.2.1/lib/active_support/dependencies.rb:291:in `load_dependency'
    53: from /Users/Nerian/.rvm/gems/ruby-2.6.5/gems/activesupport-6.0.2.1/lib/active_support/dependencies.rb:325:in `block in require'
    52: from /Users/Nerian/.rvm/gems/ruby-2.6.5/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
    51: from /Users/Nerian/.rvm/gems/ruby-2.6.5/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require_with_bootsnap_lfi'
    50: from /Users/Nerian/.rvm/gems/ruby-2.6.5/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
    49: from /Users/Nerian/.rvm/gems/ruby-2.6.5/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `block in require_with_bootsnap_lfi'
    48: from /Users/Nerian/.rvm/gems/ruby-2.6.5/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require'
    47: from /Users/Nerian/.rvm/gems/ruby-2.6.5/gems/railties-6.0.2.1/lib/rails/commands.rb:18:in `<main>'
    46: from /Users/Nerian/.rvm/gems/ruby-2.6.5/gems/railties-6.0.2.1/lib/rails/command.rb:46:in `invoke'
    45: from /Users/Nerian/.rvm/gems/ruby-2.6.5/gems/railties-6.0.2.1/lib/rails/command/base.rb:69:in `perform'
    44: from /Users/Nerian/.rvm/gems/ruby-2.6.5/gems/thor-0.20.3/lib/thor.rb:387:in `dispatch'
    43: from /Users/Nerian/.rvm/gems/ruby-2.6.5/gems/thor-0.20.3/lib/thor/invocation.rb:126:in `invoke_command'
    42: from /Users/Nerian/.rvm/gems/ruby-2.6.5/gems/thor-0.20.3/lib/thor/command.rb:27:in `run'
    41: from /Users/Nerian/.rvm/gems/ruby-2.6.5/gems/railties-6.0.2.1/lib/rails/commands/console/console_command.rb:101:in `perform'
    40: from /Users/Nerian/.rvm/gems/ruby-2.6.5/gems/railties-6.0.2.1/lib/rails/command/actions.rb:14:in `require_application_and_environment!'
    39: from /Users/Nerian/.rvm/gems/ruby-2.6.5/gems/railties-6.0.2.1/lib/rails/command/actions.rb:22:in `require_application!'
    38: from /Users/Nerian/.rvm/gems/ruby-2.6.5/gems/activesupport-6.0.2.1/lib/active_support/dependencies.rb:325:in `require'
    37: from /Users/Nerian/.rvm/gems/ruby-2.6.5/gems/activesupport-6.0.2.1/lib/active_support/dependencies.rb:291:in `load_dependency'
    36: from /Users/Nerian/.rvm/gems/ruby-2.6.5/gems/activesupport-6.0.2.1/lib/active_support/dependencies.rb:325:in `block in require'
    35: from /Users/Nerian/.rvm/gems/ruby-2.6.5/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
    34: from /Users/Nerian/.rvm/gems/ruby-2.6.5/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require_with_bootsnap_lfi'
    33: from /Users/Nerian/.rvm/gems/ruby-2.6.5/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
    32: from /Users/Nerian/.rvm/gems/ruby-2.6.5/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `block in require_with_bootsnap_lfi'
    31: from /Users/Nerian/.rvm/gems/ruby-2.6.5/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require'
    30: from /Users/Nerian/projects/drakma-app/config/application.rb:7:in `<main>'
    29: from /Users/Nerian/.rvm/gems/ruby-2.6.5/gems/bundler-2.1.4/lib/bundler.rb:174:in `require'
    28: from /Users/Nerian/.rvm/gems/ruby-2.6.5/gems/bundler-2.1.4/lib/bundler/runtime.rb:58:in `require'
    27: from /Users/Nerian/.rvm/gems/ruby-2.6.5/gems/bundler-2.1.4/lib/bundler/runtime.rb:58:in `each'
    26: from /Users/Nerian/.rvm/gems/ruby-2.6.5/gems/bundler-2.1.4/lib/bundler/runtime.rb:69:in `block in require'
    25: from /Users/Nerian/.rvm/gems/ruby-2.6.5/gems/bundler-2.1.4/lib/bundler/runtime.rb:69:in `each'
    24: from /Users/Nerian/.rvm/gems/ruby-2.6.5/gems/bundler-2.1.4/lib/bundler/runtime.rb:74:in `block (2 levels) in require'
    23: from /Users/Nerian/.rvm/gems/ruby-2.6.5/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
    22: from /Users/Nerian/.rvm/gems/ruby-2.6.5/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require_with_bootsnap_lfi'
    21: from /Users/Nerian/.rvm/gems/ruby-2.6.5/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
    20: from /Users/Nerian/.rvm/gems/ruby-2.6.5/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `block in require_with_bootsnap_lfi'
    19: from /Users/Nerian/.rvm/gems/ruby-2.6.5/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require'
    18: from /Users/Nerian/.rvm/gems/ruby-2.6.5/gems/candy_check-0.0.3/lib/candy_check.rb:4:in `<main>'
    17: from /Users/Nerian/.rvm/gems/ruby-2.6.5/gems/activesupport-6.0.2.1/lib/active_support/dependencies.rb:325:in `require'
    16: from /Users/Nerian/.rvm/gems/ruby-2.6.5/gems/activesupport-6.0.2.1/lib/active_support/dependencies.rb:291:in `load_dependency'
    15: from /Users/Nerian/.rvm/gems/ruby-2.6.5/gems/activesupport-6.0.2.1/lib/active_support/dependencies.rb:325:in `block in require'
    14: from /Users/Nerian/.rvm/gems/ruby-2.6.5/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
    13: from /Users/Nerian/.rvm/gems/ruby-2.6.5/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require_with_bootsnap_lfi'
    12: from /Users/Nerian/.rvm/gems/ruby-2.6.5/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
    11: from /Users/Nerian/.rvm/gems/ruby-2.6.5/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `block in require_with_bootsnap_lfi'
    10: from /Users/Nerian/.rvm/gems/ruby-2.6.5/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require'
     9: from /Users/Nerian/.rvm/gems/ruby-2.6.5/gems/candy_check-0.0.3/lib/candy_check/play_store.rb:1:in `<main>'
     8: from /Users/Nerian/.rvm/gems/ruby-2.6.5/gems/activesupport-6.0.2.1/lib/active_support/dependencies.rb:325:in `require'
     7: from /Users/Nerian/.rvm/gems/ruby-2.6.5/gems/activesupport-6.0.2.1/lib/active_support/dependencies.rb:291:in `load_dependency'
     6: from /Users/Nerian/.rvm/gems/ruby-2.6.5/gems/activesupport-6.0.2.1/lib/active_support/dependencies.rb:325:in `block in require'
     5: from /Users/Nerian/.rvm/gems/ruby-2.6.5/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:26:in `require'
     4: from /Users/Nerian/.rvm/gems/ruby-2.6.5/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:40:in `rescue in require'
     3: from /Users/Nerian/.rvm/gems/ruby-2.6.5/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require_with_bootsnap_lfi'
     2: from /Users/Nerian/.rvm/gems/ruby-2.6.5/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/loaded_features_index.rb:89:in `register'
     1: from /Users/Nerian/.rvm/gems/ruby-2.6.5/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `block in require_with_bootsnap_lfi'
/Users/Nerian/.rvm/gems/ruby-2.6.5/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require': cannot load such file -- google/api_client (LoadError)
Nerian commented 4 years ago

Oh I noticed that if I just put gem 'candy_check' in the Gemfile it will use a very old version of candy_check. If I force the current version for candy_check, then google-api-client is downgraded.

From 0.36.4 to 0.34.1 .

And Rails loads.

gem 'google-api-client'
gem 'candy_check', '0.2.1'
jnbt commented 4 years ago

I think this is related to having candy_check's Google Api dependency set to ~> 0.34.0. Maybe we should soften this restriction to ~> 0.34?

@christophweegen What is your opinion here? Can you test with google-api-client:0.36.4?

Nerian commented 4 years ago

Any news?

christophweegen commented 4 years ago

Hey @Nerian, sorry for the late reply. I just released candy_check:0.3.0 which uses google-api-client:0.43.0. Can you please check if your problem still persists after upgrading?

Nerian commented 4 years ago

Thanks!