Pages

Friday, August 6, 2010

Heroku is one of the popular web based ruby hosting platform to launch our rails application. We can host our ROR demo applications free of cost to a certain level. Features like repository support, database support,etc are available. Using this we can host our application, work on that application from anywhere and update the application at anytime.

Prerequisites:

The following things are required in order to deploy the ROR application on Heroku.

An account is needed in order to work with Heroku.create an account from the Heroku site. Your username and password credentials are required in order to deploy the application. You can also create an application inside the heroku account for checking purpose.

GitHub Account Setup

GitHub account is required in order to authenticate the public keys in repository.Create a free account in the Git Hub site After you logged in to the account, you need to upload the SSH public keys generated in the Public(ssh) key generation.

Repository Setup - Git Installation

In order to work with heroku, git repository is required.Download the latest Git version and install it.

Public(ssh) key generation

A public SSH key is required in order to authenticate the remote servers. There are different ways to create SSH public key. If your Git repository installation is already done, you can create as like below.

In order to test your git remote repository, you need to copy the SSH key files(id_rsa.pub and id_rsa) and paste it in .ssh folder in [C:\Program Files\Git\.ssh].

Type the following in the commmand prompt

ssh git@github.com

if Successfully authenticated message comes, then your remote repository setup will be working fine.

Heroku Installation

In order to deploy rails on heroku, Heroku gem needs to be installed in your system.

Type the following in the commmand prompt

set path=%path%;c:\ruby\bin; [set the ruby path]

gem install heroku [Remote installation of heroku gem]

heroku list[To list down the deployed applications]

It will ask to enter your heroku user crendentials.If, No public ssh key found error will be displayed, it means that, ssh authentication key is required. For that, you need to copy the SSH key files(id_rsa.pub and id_rsa) and paste it in .ssh folder in C:\Documents and Settings\[user]\.ssh.

Now if you run heroku list command again, successful authetication occurs by entering the user credentials and it will list down the applications that are currrently running in your heroku account.

Sunday, August 1, 2010

Ruby on Rails, often shortened to Rails or RoR, is an open source web application framework for the Ruby programming language. It is intended to be used with an Agile development methodology that is used by web developers for rapid development.

Prerequisites:

The following things are required in order to set up the ROR environment.

Rails framework is created using Ruby language and hence setting up the Ruby environment is the first thing to proceed. Download the latest ruby file ruby186-26.exe for windows and install it.

Testing the Ruby environment

Before moving on to rails, we need to test whether our ruby environment is set up properly or not. There are many tutorials available for testing it and you can check this blog Execute RUBY program on Command Prompt which is very simple to check at this stage.

Rails Installation

Once the ruby enviroment is ready, it is the time to install rails.Type the following in command prompt

gem update --system [To update the system with latest gems for ruby]

Ex: C:\ruby\prg>gem update --system

gem install rails --include-dependencies [Installation of rails along with all dependencies]

Ex: C:\ruby\prg>gem install rails --include-dependencies

The above installation is completed by automatically downloading from ruby site.

Setting up the server

Once the application is installed, we need to check whether the server setup is completed.By default, WEBrick server is coming along with rails installation. There is no seperate installation required.

In order to check the server, a sample application is required.

Type the following in command prompt

rails MyRails [creating an application called MyRails]

Ex: c:\rails>rails MyRails

Ex: c:\rails>ruby script/server [start the server & You will get a message console as given below....]