2008/01 20
1、安装ruby:
下载地址: http://rubyforge.org/frs/?group_id=167

2、安装rails
gem install rails --include-dependencies

3. rails一个新的项目:
*rails会使用sqlite3作为默认数据库,需要加-d参数
rails rubytest -d mysql

4. 创建数据库: rubytest_development,并修改config/database.yaml,填写数据库密码
*注意,密码末尾不能有空格
5、启动服务
cd rubytest
ruby script\server

6、创建并编辑一个conroller
ruby script\generate controller MyTest

内容如下:

class MyTestController < ApplicationController
def index
render:text => "Helo, World"
end
end

7、访问http://127.0.0.1:3000/My_Test,查看hello,world

Defined tags for this entry:

Posted by rollenc

Last modified on 2008-01-25 23:50

0 Trackbacks

  1. No Trackbacks

0 Comments

  1. No comments

Add Comment


E-Mail addresses will not be displayed and will only be used for E-Mail notifications.