ruby-on-railsrubymercadopagomercadopagosdk

Uninitialized constant MercadoPago::SDK


I have the following error uninitialized constant MercadoPago::SDK , this I am trying in my controller

I already put the gem of mercadopago-sdk

def show
    MercadoPago::SDK.client_id = "XXXXXXXXXXXX"
    MercadoPago::SDK.client_secret = "XXXXXXXXXXXXXXXXXXXXXX"
end

Solution

  • The issue here might be two things:

    1. You haven't restarted your rails server. You will need to do this after you change your Gemfile.
    2. A less common version of this same issue is that spring -- the Rails application preloader -- may be caching an older version of your application. You can restart this by running spring stop, stopping your rails server process, and then starting rails server again.