访问Shopify API时,在非Rails环境中的URI.parser中出现Ruby贬值警告

wtlkbnrh  于 2023-06-29  发布在  Ruby
关注(0)|答案(1)|浏览(101)

在ruby non-rail环境中使用身份验证凭据配置Shopify API时,会出现折旧警告。
下面是复制它的最小代码:

#!/usr/bin/ruby

require 'shopify_api'

API_KEY='my key'
PASSWORD='my password'
SHOP_NAME='my shop name'

shop_url = "https://#{API_KEY}:#{PASSWORD}@#{SHOP_NAME}.myshopify.com/admin"
ShopifyAPI::Base.api_version = '2020-10'
ShopifyAPI::Base.site = shop_url
kcrjzv8t

kcrjzv8t1#

这个问题仍在发生,这里是我的脚本的当前版本来测试它,后面是相关的版本号和确切的错误消息。

% cat miniTestConnect.rb 
#!/usr/bin/env ruby

require 'shopify_api'

API_KEY='my api key'
PASSWORD='my password'
SHOP_NAME='my shop name'

shop_url = "https://#{API_KEY}:#{PASSWORD}@#{SHOP_NAME}.myshopify.com/admin"
ShopifyAPI::Base.api_version = '2023-04'
ShopifyAPI::Base.site = shop_url

% miniTestConnect.rb
DEPRECATION WARNING: URI.parser is deprecated and will be removed in Rails 7.0. Use `URI::DEFAULT_PARSER` instead. (called from <main> at miniTestConnect.rb:15)
DEPRECATION WARNING: URI.parser is deprecated and will be removed in Rails 7.0. Use `URI::DEFAULT_PARSER` instead. (called from <main> at miniTestConnect.rb:15)

% cat testRubyVersion.rb 
#!/usr/bin/env ruby

puts RUBY_VERSION

% testRubyVersion.rb
3.1.2

% find ../.. -name shopify_api                              
../../.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/shopify_api-9.4.1/lib/shopify_api

相关问题