Deploying the clone
There are a few ways to run the Sinatra web application. The simplest is probably to run it off the command line. To do this, we need to set up the database. We assume that for this application you would have installed MySQL. At the command line go into the MySQL interactive command console:
$ mysql –u <username> -p <password>
Then just execute the following command:
mysql> create database tinyclone;
This will just create the database. Next, go into IRB and run this command:
> require 'tinyclone'
This will require the necessary classes for creating the database tables. Next, just run this command:
> DataMapper.auto_migrate!
This will create the tables for the application. To run the application, we just need to run this at the command line:
$ ruby tinyclone.rb
Then, go to http://localhost:4567/
and you will see the running application:
This is how the info page looks:
Alternatively we can also deploy to Heroku, the Ruby cloud-computing platform. Deploying...