0

Getting an error while trying to generate access token for video Using twilio-ruby (4.11.1), ruby 2.4.1, rails 5.1.0.

Code:

    # Create an Access Token
    token = Twilio::JWT::AccessToken.new(account_sid, api_key, api_secret, identity);

following the twilio official Doc. https://www.twilio.com/docs/api/video/user-identity-access-tokens#ruby

Error which am facing:

NameError: uninitialized constant Twilio::JWT
devudilip
  • 1,270
  • 14
  • 25

1 Answers1

1

Twilio developer evangelist here.

That example code appears to be written for the upcoming version 5 of the Twilio Ruby gem. The version 5 gem is at rc23 so I recommend using that to create your access token as it has the methods required to make a Video Grant for the rooms API.

Let me know if that helps at all.

philnash
  • 70,667
  • 10
  • 60
  • 88
  • i have created an issue on github, it should work with rc24, as rc23 still has issues with Authentication::VideoGrant. I have accepted your answer, please update the rc23 to rc24 https://github.com/twilio/twilio-ruby/issues/283 – devudilip Jun 20 '17 at 19:08
  • Thanks for raising that, looks like it's getting sorted quickly! – philnash Jun 20 '17 at 19:11