Why is the Shopify API version causing errors in my Ruby program?

Hello Everyone,

I’ve not used Shopify for the past few months. But today, I tried running my ruby programs that used to work, just a few months back, but now I’m getting error “uninitialized constant ShopifyAPI::Base (NameError)”.

The line that caused this error is this - ShopifyAPI::Base.api_version = “2021-01”

I’m just running a plain simple ruby program, not Rails.

Any idea what has changed recently to cause that line of code to fail?

Any advice will be greatly appreciated.

Thanks!

I think I figured it out. When I ran “gem install shopify_api”, the latest version which is 10.1.0 was installed. I uninstalled this version and reinstalled using this command “gen install shopify_api -v 9.4.1”. This time around, my code is working again.

Any guide or sample ruby code using the latest version will be very much appreciated.

Thanks!