RUBY ON RAILS - HELLO WORLD

1检测ruby平台是否安装成功
 cmd下:ruby-v和 gem --version 执行成功

2 use RubyGems to install Rails and a few things that Rails needs

 c:\>gem install rails --include-dependencies

安心等待如下的信息提示

Successfully installed rails-1.2.3
Successfully installed activerecord-1.15.3
Successfully installed actionpack-1.13.3
Successfully installed actionmailer-1.3.3
Successfully installed actionwebservice-1.2.3
Installing ri documentation for activerecord-1.15.3...
Installing ri documentation for actionpack-1.13.3...
Installing ri documentation for actionmailer-1.3.3...
Installing ri documentation for actionwebservice-1.2.3...
Installing RDoc documentation for activerecord-1.15.3...
Installing RDoc documentation for actionpack-1.13.3...
Installing RDoc documentation for actionmailer-1.3.3...
Installing RDoc documentation for actionwebservice-1.2.3...

3 在线更新
 gem update rails

response like this

C:\>gem update rails
Updating installed gems...
Attempting remote update of rails
Successfully installed rails-1.2.3
Gems: [rails] updated

4 创建ruby工程

--> rails demo 将创建一个ruby结构的schelton

5 启动服务器WEBrick (类似Tomcat功能)
   ruby script/server
   ps:创建了Say 应用程序之后,并且创建了hello.rhtml文件后,但是一直访问不到。
   原因是:我在script目录下运行了WEBrick服务器,导致日志文件下一直提示
Cannot load config/routes.rb: No such file to load—./../config/../config/routes.rb
这样的信息,最后回到cmd的demo目录,然后用命令ruby script/server后才能访问。

!!!!!!!server的启动目录会影响我们的应用程序访问上下文。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值