messagebird / ruby-rest-api

MessageBird's REST API for Ruby
BSD 2-Clause "Simplified" License
37 stars 46 forks source link

NameError: uninitialized constant MessageBird::Client #15

Closed ruby24 closed 6 years ago

ruby24 commented 6 years ago

image

Not a great developer myself, but I get almost everything at least more or less running... Except for your gem.

Running

require 'pp' require 'messagebird' client = MessageBird::Client.new("kzO6....[redacted]")

leads to "NameError: uninitialized constant MessageBird::Client"

Ruby version 2.4.1, no errors anywhere else when developing and running short scripts... We're a reasonably big messagebird customer and want to use the script locally to transmit manual passwords to high-volume clients.

Any idea why it's not working? Thanks!

p.s.: Gem is correctly installed and present, had the same issue on the previous messagebird version

Installing ri documentation for messagebird-rest-1.3.3 Done installing documentation for messagebird-rest after 0 seconds 1 gem installed

marcelcorso commented 6 years ago

Hi @ruby24. We've seen this before.

This happens when there is a problem with the gem installation. Are you using multiple versions of ruby using rvm or rbenv or something like this?

can you try gem list?

I see you are running the compiler using an IDE. Can you try on the command line?

ruby24 commented 6 years ago

I'm using rvm, the IDE is textmate (still somehow like it for scripts).

Anyways, tried irb - messagebird is not working there either. Gems seem to be correctly installed in gem list on the command line... and "require messagebird" works in irb.

Also, same in Atom Runner.

Could definitely be that my setup is a bit screwed up, but I don't have any issues with any other gems in scripts or rails projects.

Thanks for taking the time!

screen shot 2018-06-26 at 20 31 38

"Gem list" on command line:

screen shot 2018-06-26 at 20 32 18
marcelcorso commented 6 years ago

Yep. Packaging code is never easy!! 😅 Getting the device environment right is super hard!

Just one thing: you have two messagebird gems. The good one is 'messagebird-rest' the other one I'm not sure what it does.

ruby24 commented 6 years ago

Removed "messagebird-rest" and now it finally works 👍 :)

Really no idea where I got it from, I remember gem install"ing" messagebird and messagebird-rest a few times back and forth when I was testing (got somehow confused by gem install messagebird-rest vs require "messagebird").

Thanks so much for the personal tech support during off hours, we're a happy customer :)

p.s.: fyi, accidentally exposed a key in one screenshot, deleted the key in the MB dashboard (and the screenshot here)