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:
Lighttpd
RailsOnOpenBSD
GettingStartedWithRails
Tutorial in Ruby on Rails
I create a project in /var/www/
Code:
# rails testproject
I start lighttpd
Code:
# cd testproject
# ./script/server lighttpd
=> Booting lighttpd (use 'script/server webrick' to force WEBrick)
=> Rails application started on http://192.168.0.1:80
=> Call with -d to detach
=> Ctrl-C to shutdown server (see config/lighttpd.conf for options)
Now I surf to
http://192.168.0.1/ and I get a nice page saying I am running on rails.
Next I set up an application
Code:
# ./script/generate controller hello index
Surfing to
http://192.168.0.1/hello shows a page saying Hello#index, etc... It works fine.
Now I change these files:
Code:
File: /var/www/testproject/apps/controllers/hello_controller.rb
class HelloController < ApplicationController
def index
end
def world
@greeting = "hello world!"
end
end
Code:
File: /var/www/testproject/apps/views/hello/index.rhtml
<h1>Hello#index</h1>
<%= @greeting %>
Now when I surf to
http://192.168.0.1/hello all I get is Hello#index but no "hello world". When I check the page source I see this:
Code:
<h1>Hello#index</h1>
and in the console this shows up:
Code:
Processing HelloController#index (for 192.168.0.33 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 [http://192.168.0.1/hello]
Something is wrong. But what?