Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calls to Diplomat::Service fail with uninitialized constant Diplomat::Service::OpenStruct #26

Closed
thedebugger opened this issue Apr 23, 2015 · 10 comments
Labels

Comments

@thedebugger
Copy link
Contributor

I think we need to add require 'ostruct'. Weird that no one ran into this issue. Thoughts?

@johnhamelink
Copy link
Member

Hey @thedebugger thanks for this! I will look into it on the weekend and see why the tests aren't failing before we try and fix this.

@johnhamelink
Copy link
Member

@thedebugger it's strange that I'm not getting any error when I'm running the specs, and both the code and the specs use openstruct quite regularly.

I also tried querying for a service from irb:

    consul agent -bootstrap -server -data-dir=/tmp
    irb
    require_relative 'lib/diplomat.rb'
    Diplomat::Service.get 'consul'
    => #<OpenStruct Node="Johns-MacBook-Pro-3.local", Address="10.133.10.100", ServiceID="consul", ServiceName="consul", ServiceTags=[], ServicePort=8300>

@thedebugger
Copy link
Contributor Author

@johnhamelink, rspecs works fine. And, what gems did you load in 'irb'? I think you will be able to replicate the problem when the application (and it dependencies) doesn't require 'ostruct'. To workaround, I added require 'ostruct' in my application and calls work fine then.

@johnhamelink
Copy link
Member

@thedebugger other than cd'ing into the diplomat source, I'm not doing anything other than what I described in the comment above... I will explicitly include ostruct if this solves your issue, but I'm still not 100% on why its not happening for anyone else...

@thedebugger
Copy link
Contributor Author

hmm..let me see if I can replicate it.

@johnhamelink
Copy link
Member

Thanks @thedebugger :)

@johnhamelink
Copy link
Member

How did you get on @thedebugger ?

@thedebugger
Copy link
Contributor Author

Didn't get a chance to reproduce it, yet.


Sent from Mailbox

On Thu, May 7, 2015 at 9:23 PM, John Hamelink notifications@github.com
wrote:

How did you get on @thedebugger ?

Reply to this email directly or view it on GitHub:
#26 (comment)

@johnhamelink
Copy link
Member

Cool, let us know when you get round to it 👍

@johnhamelink
Copy link
Member

@thedebugger I'm going to close this issue for now until you can get back to us! Thanks 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants