Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Twilio Best Practices

You're reading from   Twilio Best Practices Learn how to build powerful real-time voice and SMS applications with Twilio

Arrow left icon
Product type Paperback
Published in Dec 2014
Publisher
ISBN-13 9781782175896
Length 178 pages
Edition 1st Edition
Tools
Arrow right icon
Toc

Table of Contents (10) Chapters Close

Ruby


We can install the twilio-ruby library using the ubiquitous RubyGems software. Much like Composer in the PHP world, it's a package manager that makes it easy to install and manage dependencies.

We can install the gem on its own by running gem install twilio-ruby from a terminal/Command Prompt. This will make the gem available in Interactive Ruby Shell (IRB).

However, in the context of a Ruby project, we usually manage our gem dependencies through a Gemfile. This file specifies a source for downloading gems, usually https://rubygems.org, and then lists gems to be installed. You also have the ability to specify the version you want to use and can install different sets of gems for different environments (for instance, you might have different gems for production use and running tests).

A basic Gemfile using the Twilio library would look like this:

source "https://rubygems.org" gem 'twilio-ruby', '~> 3.12'

Once we've added the gem to our dependencies, we can install the library with Bundler...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime