Register a domain and help support LQ
Go Back > Forums > Linux Forums > Linux - Server
User Name
Linux - Server This forum is for the discussion of Linux Software used in a server related context.


  Search this Thread
Old 09-24-2006, 04:30 PM   #1
Senior Member
Registered: Sep 2004
Location: Sweden
Distribution: Ubuntu, Debian
Posts: 1,109

Rep: Reputation: 49
Getting started with Ruby on Rails

I am using OpenBSD and am trying to get started with Ruby on Rails.

I have installed lighttpd, ruby, ruby-gems and fastcgi, and via gems I have installed rails and fcgi.
I have followed the guides:
Tutorial in Ruby on Rails

I create a project in /var/www/
# rails testproject
I start lighttpd
# cd testproject
# ./script/server lighttpd
=> Booting lighttpd (use 'script/server webrick' to force WEBrick)
=> Rails application started on
=> Call with -d to detach
=> Ctrl-C to shutdown server (see config/lighttpd.conf for options)
Now I surf to and I get a nice page saying I am running on rails.

Next I set up an application
# ./script/generate controller hello index
Surfing to shows a page saying Hello#index, etc... It works fine.

Now I change these files:
File: /var/www/testproject/apps/controllers/hello_controller.rb
class HelloController < ApplicationController

  def index

  def world
    @greeting = "hello world!"
File: /var/www/testproject/apps/views/hello/index.rhtml
<%= @greeting %>
Now when I surf to all I get is Hello#index but no "hello world". When I check the page source I see this:
and in the console this shows up:
Processing HelloController#index (for at 2006-09-24 22:26:42) [GET]
  Session ID: a51585872d8e13bfaf3c424a1d9fcbf3
  Parameters: {"action"=>"index", "controller"=>"hello"}
Rendering hello/index
Completed in 0.24990 (4 reqs/sec) | Rendering: 0.09091 (36%) | 200 OK []
Something is wrong. But what?
Old 09-24-2006, 04:40 PM   #2
Senior Member
Registered: Sep 2004
Location: Sweden
Distribution: Ubuntu, Debian
Posts: 1,109

Original Poster
Rep: Reputation: 49

It seems that the problem was easy (even though no one at #rubyonrails at freenode knew the answer (?)):

I did not surf to hostname/hello/world, if I put the @greeting-variable in the index def instead it showed up fine. Sooo simple, but still.. no help from the guys at irc. :P


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Can you help me with search in Ruby on Rails? viniosity Programming 1 01-05-2007 07:25 PM
LXer: Ruby on Rails LXer Syndicated Linux News 0 07-03-2006 08:54 PM
Ruby on Rails, on Linux. After the install... caledfwlch Programming 1 06-25-2006 12:47 AM
LXer: Ruby on Rails LXer Syndicated Linux News 0 02-16-2006 05:16 PM
LXer: Ruby off the Rails LXer Syndicated Linux News 0 12-24-2005 05:31 PM

All times are GMT -5. The time now is 10:52 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration