Page 262 - Asterisk™: The Future of Telephony
P. 262

Installing Ruby/RubyGems on Linux
               Most Linux distributions’ package managers host a Ruby package, though some do
               not yet have RubyGems. With your respective distro’s preferred software management
               application, install Ruby 1.8.5 or later and RubyGems if available. If RubyGems is not
               available in CentOS, you can install Ruby by typing:
                   yum install ruby
               Next, we need RubyGems. You can get that by navigating to /usr/src/, and entering:
                   wget http://rubyforge.org/frs/download.php/20585/rubygems-0.9.3.tgz
                   tar zxvf rubygems-0.9.3.tgz
                   cd rubygems-0.9.3
                   ruby setup.rb
               Installing Ruby/RubyGems on Mac OS X
               Ruby actually ships standard with OS X, but you will need to upgrade it and install
               RubyGems from MacPorts, an OS X package manager. With MacPorts installed, (avail-
               able from http://www.macports.org if you do not already have it) you can install Ruby
               and RubyGems with the following command:
                   sudo port install ruby rb-rubygems
               You may also need to add /opt/local/bin to your PATH variable in /etc/profile.

               Ruby/RubyGems on Windows
               A fantastic “one-click installer” exists for Windows. This installer will automatically
               install Ruby, RubyGems, and a few commonly used gems all in a matter of minutes.
               You can download the installer from http://rubyforge.org/projects/rubyinstaller.

               Installing Adhearsion from RubyGems
               Once you’ve followed one of the previous set of instructions for your system to fetch
               Ruby and RubyGems, install Adhearsion with the following command:

                   gem install adhearsion
               If any dependencies are found, you will probably need to allow them to install for
               Adhearsion to work correctly.

               Exploring a New Adhearsion Project

               With Adhearsion installed, you can begin creating and initializing a new Adhearsion
               project with the newly created ahn command, a command-line utility that manages
               nearly everything in Adhearsion.
               A sample command for creating a new Adhearsion project is as follows:

                   ahn create ~/newproject


               234 | Chapter 10: Asterisk Manager Interface (AMI) and Adhearsion
   257   258   259   260   261   262   263   264   265   266   267