Closed aknicol closed 9 years ago
Are you setting up your API key in the ENV['CLOSEIO_API_KEY']
variable?
Yes. I'm on Rails 4.3, and I've added ENV['CLOSEIO_API_KEY'] in secrets.yml. I've also tried it on Heroku, where I've set the env variable using heroku config:set. In both cases I get the same error. Any help would be appreciated.
Hi @aknicol, I just merged in a PR that allows you to configure the gem with a closeio.yml
file. Would you try that and see if it works?
Info is in the README.
Thanks for that. I've updated the gem and created config/initializers/closeio.yml with the following contents:
api_key: '86241a9a99bcaff237079c837ea665456dfff883d3290b264b55b86b'
Is this correct? Because I still get the same error.
Yes, that's how it should be configured.
But you probably want to delete your api_key now as it's been exposed.
Yeah, I didn't use the actual key.
No idea then why I'm getting the error?
I just pushed a 1.0.0
version where you can call Closeio.configure('api_key')
.
Try that and see if it fixes your issue. You may want to put that in an initializer.
That works. Thanks!
I get the following whenever running any query using the gem:
HTTParty::ResponseError: HTTParty::ResponseError from /Users/Andrew/.rvm/gems/ruby-2.1.3/gems/closeio-0.0.13/lib/closeio/base.rb:31:in
bad_response' from /Users/Andrew/.rvm/gems/ruby-2.1.3/gems/closeio-0.0.13/lib/closeio/base.rb:65:in
find'