Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/62.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails Nexmo-Rails中未定义的方法send_消息_Ruby On Rails_Nexmo - Fatal编程技术网

Ruby on rails Nexmo-Rails中未定义的方法send_消息

Ruby on rails Nexmo-Rails中未定义的方法send_消息,ruby-on-rails,nexmo,Ruby On Rails,Nexmo,我正在尝试使用nexmo gem发送短信 直到几天前,代码还在正常工作。 def发送短信 @编号=参数[:编号] @nannytel=params[:电话] nexmo=nexmo::Client.new( 关键字:“xxxxxxx”, 秘密:“XXXXXX” ) 通知=“联系电话如下#{@nannytel}” response=nexmo.send\u消息( 发件人:“SENDERID”, 致:@number, 文本:通知 ) 如果响应['messages'].first['status']

我正在尝试使用nexmo gem发送短信

直到几天前,代码还在正常工作。

def发送短信
@编号=参数[:编号]
@nannytel=params[:电话]
nexmo=nexmo::Client.new(
关键字:“xxxxxxx”,
秘密:“XXXXXX”
)
通知=“联系电话如下#{@nannytel}”
response=nexmo.send\u消息(
发件人:“SENDERID”,
致:@number,
文本:通知
)
如果响应['messages'].first['status']='0'

flash[:success]=“Yayy!请修改以下代码

response = nexmo.sms.send(
  from: "SENDERID",
  to: @number,
  text: notification
)
作为

根据版本
5.0.2

使用版本
4.8
而不是
5.0.2


您使用的是哪个版本的
nexmo
gem?这是最新版本的5.0.2降级gem完成了任务:)非常感谢Ganesh
response = nexmo.sms.send(
  from: "SENDERID",
  to: @number,
  text: notification
)
gem 'nexmo', '4.8'