Kattare Internet Hosting Home | Home | Services | Contact Us | Order Online! |   whitespace image
  Kattare I/S: View FAQ Answer

| Webmail | Forums | News | FAQ | Members Login |  

whitespace image
tail end of the Kattare logo Toll Free: (866) KATTARE -or- (877) KATTARE
Local: (541) 753-1079
keyboard image for php hosting, jsp hosting, servlet hosting, java hosting website
Better Business Bureau Online  
whitespace image

   

whitespace image
greenspace image for php hosting, jsp hosting, servlet hosting, java hosting website

Home

Hosting Services

Server Co-Location
Dedicated Server
Java Servlet Hosting
Website Hosting
WHOIS Lookup
Join Us Today!

Members

Member Forums
Documentation
Kattare F.A.Q.
Free Software
Members Section
News
Referral System
Spam Blocking
Webmail

Development

Programming
Website Design
Graphic Design

Company

About Us
Contact Us
Our Network
Page Us
Sites We Host
Terms of Service


whitespace image
Documentation

Kattare is dedicated to making your hosting experience as painless as possible. That means making as much help and documentation available as possible.

Quick Links
[Frequently Asked Questions]
[User Forums]
[Howto's]
Category
Ruby Programming (incl Rails)
Question

Last Modified: Apr 17, 2008

How do I setup Ruby On Rails? (with FastCGI)
Answer
In this example,

<domainname> = burnside.kattare.com
<document_root> = ~/burnside_kattare_com
<appname> = burnside_on_rails
<controller> = Hello
<username> = burnside
<action> = hello

cd ~<username>

Use the rails command to setup the application base.

rails <appname>

Link the application base into your document root.

ln -s ../<appname>/public <document_root>/<appname>

vi/pico <appname>/public/.htaccess

change dispatch.cgi to dispatch.fcgi, this will speed things up significantly.

vi/pico <appname>/public/dispatch.fcgi

Change dispatch.fcgi to use gems by changing
    require File.dirname(__FILE__) + "/../config/environment"
    require 'fcgi_handler'
to
    require 'rubygems'
    gem 'fcgi'
    require 'fcgi'
    require File.dirname(__FILE__) + "/../config/environment"
    require 'fcgi_handler'
Generate a controller.

cd <appname>
./script/generate controller Hello
vi/pico app/controllers/hello_controller.rb
class HelloController < ApplicationController
  def hello
  end
end
Setup a view:

vi/pico app/views/hello/hello.rhtml
<html>
  <head>
    <title>Hello Rails World</title>
  </head>
  <body>
    <h1>Hello from Rails on Kattare!</h1>
    <p>The current time is <%= Time.now %></p>
  </body>
</html>

Test!
http://burnside.kattare.com/burnside_on_rails/Hello/hello
(http://<yourdomain>/<appname>/<controller>/<action>)
Looks good!

[FAQ Main] [Submit a Question]

[Back to Category "Ruby Programming (incl Rails)"]


whitespace image
green spacer Kattare Logo whitespace image
 
whitespace image
whitespace image