我正在使用 twilio 并得到:错误 undefined method `account' for Twilio。
client = Twilio::REST::Client.new('twilio_sid','twilio_token')
# Create and send an SMS message
client.account.sms.messages.create(
from: "+12345678901",
to: user.contact,
body: "Thanks for signing up. To verify your account, please reply HELLO to this message."
)
最佳答案
您在调用链中错过了 api
。试试这个:
client.api.account.messages.create(
from: "+12345678901",
to: user.contact,
body: "Thanks for signing up. To verify your account, please reply HELLO to
this message."
)
关于ruby-on-rails - Twilio 的未定义方法 `account',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45608720/