Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
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
Cloning Internet Applications with Ruby

You're reading from   Cloning Internet Applications with Ruby Make clones of some of the best applications on the Web using the dynamic and object-oriented features of Ruby

Arrow left icon
Product type Paperback
Published in Aug 2010
Publisher Packt
ISBN-13 9781849511063
Length 336 pages
Edition 1st Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Chang Sau Sheong Chang Sau Sheong
Author Profile Icon Chang Sau Sheong
Chang Sau Sheong
Arrow right icon
View More author details
Toc

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...

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 $19.99/month. Cancel anytime
Banner background image