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的启动目录会影响我们的应用程序访问上下文。