Configuring SMS verification

Hi, Question. How can I setup SMS verification using Twilio? I am struggling with the implementation of the Twilio REST API that was used in an this example:

I have got a Twilio account set up.

What are the steps I have to take, I am unable to update my Gemfile on my production server, Or do I just copy the Gemfile and Gemfile.lock I created locally to my current server?

Hope someone can guide me step by step through the process.

Hi i implemented the config files (sms_api.rb) and have an active account. Also installed gems ‘twilio-ruby’

But keep getting this error when testing:

LoadError in Verification::SmsController#create

cannot load such file – twilio-ruby

Extracted source (around line #1 ):

1 2 3 4 5 6 require ‘twilio-ruby’

class SMSApi

attr_accessor :client

SID = Rails.application.secrets.sms_account_sid

Extracted source (around line #16 ):

14 15 16 17 18 19 def create

@sms = Verification::Sms.new(phone: @phone, user: current_user)

if @sms.save

redirect_to edit_sms_path, notice: t(“verification.sms.create.flash.success”)

else

render :new

Rails.root: /Users/wouterschroder/consul

Application Trace | Framework Trace | Full Trace

lib/sms_api.rb:1:in `<top (required)>'app/models/verification/sms.rb:27:in `send_sms'app/models/verification/sms.rb:18:in `save'app/controllers/verification/sms_controller.rb:16:in `create'
This error occurred while loading the following files:
   twilio-ruby

Could someone help me out and tell me how to solve?

Hi, Wouter.

We recommend deploying the version you have updated with the new gems to your production server. Copying the Gemfile and Gemfile.lock directly to the server is not a good practice.

In this link you can see a guide to make deploys with capistrano.

Regards!