TCP Issues Rails

Hello, I’m having this issue while trying to implement the Stuart API on Rails. Does anyone has a solution? Thanks !

1 Like

Hello @willguill,

Thank you for your post,

It seems that you are using an older version of our client library.
A change has been made regarding the sandbox URL which is now:

Everything will work as expected if you upgrade to the latest version of our library.

Feel free to contact us again if you have further questions.


1 Like

Hello Adrien,

I’m using the code that is mentioned on this page since I’m coding my app thanks to ruby on Rails : GitHub - StuartApp/stuart-client-ruby: Stuart Ruby client

My code looks like this

def stuart_job
    environment = Stuart::Infrastructure::Environment::SANDBOX
    api_client_id = 'aa6e5a50b44cc6d92c38cde88f35fea75aaf3a631299ef9ab5f5f0ff8e3c9461' # can be found here:
    api_client_secret = 'e2af3d89b712a79357dfd7b99d9eb2de868e423e579c07a69b2cfccbdba23e60' # can be found here:
    auth =, api_client_id, api_client_secret)
    http_client =
    job = {
  job: {
    transport_type: "bike",
    pickups: [
        address: "46 Boulevard Barbès, 75018 Paris",
        comment: "Wait outside for an employee to come.",
        contact: {
          firstname: "Martin",
          lastname: "Pont",
          phone: "+33698348756",
          company: "KFC Paris Barbès"
    dropoffs: [
        address: "156 rue de Charonne, 75011 Paris",
        package_description: "Red packet.",
        client_reference: "12345678ABCDE", # must be unique
        comment: "code: 3492B. 3e étage droite. Sonner à Durand.",
        contact: {
          firstname: "Alex",
          lastname: "Durand",
          phone: "+33634981209",
          company: "Durand associates."

http_client.perform_post '/v2/jobs', JSON.generate(job)

It doesn’t mention any URL for the moment. Can you help me? Regards.

Hello @willguill,

Thank you for your response

To prevent this issue you can replace the environment variable in your code with this snippet:

class Environment
    SANDBOX = { base_url: "" }.freeze

    PRODUCTION = { base_url: "" }.freeze

environment = Environment::SANDBOX

It will prevent this error to occur for both Sandbox and Production.

Note that we are currently working on deploying a new version of the library that will solve this issue.