Ruby on rails Twilio::REST::RequestError:The';至';号码不是有效的电话号码

Ruby on rails Twilio::REST::RequestError:The';至';号码不是有效的电话号码,ruby-on-rails,ruby,twilio,Ruby On Rails,Ruby,Twilio,无论出于何种原因,删除“+”。我怎样才能阻止这一切 class UserTexter < Textris::Base default :from => "+15616005697" def welcome(user) @user = user text :to => '+' + @user.number # I've also tried hardcoding "+447576912465" end end class UserTexter“+1

无论出于何种原因,删除“+”。我怎样才能阻止这一切

class UserTexter < Textris::Base
  default :from => "+15616005697"

  def welcome(user)
    @user = user
    text :to => '+' + @user.number # I've also tried hardcoding "+447576912465"
  end
end
class UserTexter“+15616005697”
def欢迎(用户)
@用户=用户
text:to=>'+'+@user.number#我也尝试过硬编码“+447576912465”
结束
结束
控制台

UserTexter.welcome(u)
+447576912465 # See it has the plus in it
  Rendered user_texter/welcome.text.erb (0.2ms)
=> #<Textris::Message:0x007fbbffc12ee8
 @action=:welcome,
 @content="Welcome to our system!",
 @from_name="L.T.C.",
 @from_phone="17864206788",
 @texter=UserTexter,
 @to=["447576912465"]> # but then it doesn't show here
[18] pry(main)> UserTexter.welcome(u).deliver
+[+447576912465]
  Rendered user_texter/welcome.text.erb (0.6ms)
Twilio::REST::RequestError: The 'To' number 447576912465 is not a valid phone number. # hence why I get the error here
from /Users/galli01anthony/.rvm/gems/ruby-2.1.3/gems/twilio-ruby-4.11.1/lib/twilio-ruby/rest/base_client.rb:125:in `connect_and_send'
UserTexter.欢迎(u)
+447576912465#看它有什么优点吗
渲染用户_texter/welcome.text.erb(0.2ms)
=>###但是这里没有显示
[18] pry(main)>UserTexter.欢迎(u).交付
+[+447576912465]
渲染用户_texter/welcome.text.erb(0.6ms)
Twilio::REST::RequestError:“收件人”号码447576912465不是有效的电话号码。#因此我在这里得到了错误
from/Users/galli01anthony/.rvm/gems/ruby-2.1.3/gems/twilio-ruby-4.11.1/lib/twilio-ruby/rest/base\u client.rb:125:in'connect\u and\u send'
欢迎使用\u text.erb

<p>Test Text</p>
测试文本


我怎样才能解决这个问题?问题的根源是什么?我正在使用连接到Twilio API。

检查您的Twilio帐户是否处于试用模式


如果您的帐户处于试用模式,您只能向已验证的号码发送短信。

大多数情况下,它是
发送到某个地方。。您可以在控制台
“+15616005697”中检查自己。发送到
完成。没有什么特别的@Md.FarhanMemonYa..我后来意识到..我更新了注释..检查代码中的
to_i
。好的,明白了。是的,我试过@Md.FarhanMemon。不起作用:/正如我在这里看到的,这个数字没有
+
。错误是其他原因。可能是您的配置。