I am trying to send an SMS message from my Rails app via the Twilio API. I'm following the instructions here (https://github.com/twilio/twilio-ruby) but I can't seem to figure this one out.
Here is the code in my rails controller
require 'twilio-ruby'
account_sid = '[I inserted account_sid here]'
auth_token = '[I inserted auth_token here]'
@client = Twilio::REST::Client.new(account_sid, auth_token)
@client.account.messages.create(
from: '+[number here]',
to: '+[number here]',
body: 'Hey there!'
)
Returns the follow error message (ellipsis for simple privacy reasons)
NoMethodError .... undefined method `messages' for #<Twilio::REST::Account: ....
Any help would be greatly appreciated. Thanks all!