Unable to initialize Client using the Ruby SDK

I am trying to initialize a client in a Sinatra application using the Square Ruby SDK. When I do, I get the error uninitialized constant Square::Client (NameError). My code looks like
$client = Square::Client.new( access_token: '***', environment: 'sandbox' )
I have the Square gem installed, and my computer recognizes that, but it can’t find the client class. Any idea why this could be happening? Is there another Ruby gem also called Square?

Did you bundle install since your app is using Sinatra? :slight_smile:

Yup, tried both bundle install and bundle update.

That should be all you need to do to initialize the Client. Are you able to debug and see if the client is accessible? If you put in the direct path to the Client are you able to make calls to Square? :slight_smile:

I figured out the issue. I was using the square gem instead of the square.rb gem. Once I updated my gemfile and ran bundle update everything worked.

Glad to hear you figured it out! :slight_smile: