Welcome Guest | Login

rails "hello world"

I am getting no where, so I decided to start from scratch with a hello world (from Holzner: Beginning Ruby on rails)

Here's what I did

- rails voicealmighty
- cd voicealmighty
- ruby/script/generate controller app
- cd app/controllers
- edit  app_controller.rb
class AppController < ApplicationController
def greeting
end
- cd ../views/app
- edit greeting.rhtml
<html>
<head>
<title>tted test</title>
</head>
<body>
<h1> its working!</h1>
</body>
</html>

-----------------------------

Then I follwed the FastCGI tutorial
- created the mysql db & username
- edited databse.yml
- added ENV['RAILS_ENV'] ||= 'production' to environment.rb
- edited .htaccess
RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]
commented out
# General Apache options
# AddHandler fastcgi-script .fcgi
# AddHandler cgi-script .cgi
-  mv ~/public_html ~/public_html_backup
-  ln -s ~/voicealmighty/public ~/public_html

- cd voicealmighty
- mongrel_rails stop
- el_rails start -e production -p 4094 -d

now I should be able to see "its working!" from
http://<my ip address>:4094/app/greeting right?

No. it just hangs.

Help!


2008-04-17 04:02 PM

Old guy still coding
Hi

http://<my ip address>:4094/app/greeting right?

The port will be blocked at the server firewall. So please try accessing it using
http://<my ip address>/app/greeting

2008-04-17 04:08 PM

HostingRails Support
OK! its working.

I had a couple of mistakes.

First of all http://<my ip address> did give me the "welcome aboard" message; so I knew I was in business.

I have also moved my domain over successfully using zoneedit.com.

My second issue was manually generating the method "greeting". I did this in app/views/app/greeting.rhtml

when I did "ruby script/generate controller hello hithere"
the method's action was created in "app/views/hello//hithere.html.erb" . so your server uses html.erb extensions rather than rhtml

I'm in business & ready to migrate my application!

Thanks.

2008-04-18 05:14 AM

Old guy still coding

Hello Guest! In order to post you must be an active client with us, please log in or sign up.