用 rails 新建一个应用程序

D:\>cd work

D:\work>dir
驱动器 D 中的卷没有标签。
卷的序列号是 DCFD-593C

D:\work 的目录

2001-12-21 23:02 <DIR> .
2001-12-21 23:02 <DIR> ..
0 个文件 0 字节
2 个目录 10,008,469,504 可用字节

D:\work>rails demo
create
create app/controllers
create app/helpers
create app/models
create app/views/layouts
create config/environments
create config/initializers
create db
create doc
create lib
create lib/tasks
create log
create public/images
create public/javascripts
create public/stylesheets
create script/performance
create script/process
create test/fixtures
create test/functional
create test/integration
create test/mocks/development
create test/mocks/test
create test/unit
create vendor
create vendor/plugins
create tmp/sessions
create tmp/sockets
create tmp/cache
create tmp/pids
create Rakefile
create README
create app/controllers/application.rb
create app/helpers/application_helper.rb
create test/test_helper.rb
create config/database.yml
create config/routes.rb
create public/.htaccess
create config/initializers/inflections.rb
create config/initializers/mime_types.rb
create config/boot.rb
create config/environment.rb
create config/environments/production.rb
create config/environments/development.rb
create config/environments/test.rb
create script/about
create script/console
create script/destroy
create script/generate
create script/performance/benchmarker
create script/performance/profiler
create script/performance/request
create script/process/reaper
create script/process/spawner
create script/process/inspector
create script/runner
create script/server
create script/plugin
create public/dispatch.rb
create public/dispatch.cgi
create public/dispatch.fcgi
create public/404.html
create public/422.html
create public/500.html
create public/index.html
create public/favicon.ico
create public/robots.txt
create public/images/rails.png
create public/javascripts/prototype.js
create public/javascripts/effects.js
create public/javascripts/dragdrop.js
create public/javascripts/controls.js
create public/javascripts/application.js
create doc/README_FOR_APP
create log/server.log
create log/production.log
create log/development.log
create log/test.log

D:\work\demo>dir
驱动器 D 中的卷没有标签。
卷的序列号是 DCFD-593C

D:\work\demo 的目录

2001-12-21 23:52 <DIR> .
2001-12-21 23:52 <DIR> ..
2001-12-21 23:52 <DIR> app
2001-12-21 23:52 <DIR> config
2001-12-21 23:52 <DIR> db
2001-12-21 23:52 <DIR> doc
2001-12-21 23:52 <DIR> lib
2001-12-21 23:52 <DIR> log
2001-12-21 23:52 <DIR> public
2001-12-21 23:52 <DIR> script
2001-12-21 23:52 <DIR> test
2001-12-21 23:52 <DIR> vendor
2001-12-21 23:52 <DIR> tmp
2001-12-21 23:52 307 Rakefile
2001-12-21 23:52 8,819 README
2 个文件 9,126 字节
13 个目录 10,006,872,064 可用字节

D:\work\demo>ruby script/server
=> Booting WEBrick...
=> Rails application started on http://0.0.0.0:3000
=> Ctrl-C to shutdown server; call with --help for options
[2001-12-21 23:56:16] INFO WEBrick 1.3.1
[2001-12-21 23:56:16] INFO ruby 1.8.6 (2007-09-24) [i386-mswin32]
[2001-12-21 23:56:16] INFO WEBrick::HTTPServer#start: pid=3800 port=3000

然后在你的 IE 浏览器地址栏中输入:
http://localhost:3000/

在控制台中提示:
127.0.0.1 - - [21/Dec/2001:23:57:18 中国标准时间] "GET / HTTP/1.1" 200 7557
- -> /
127.0.0.1 - - [21/Dec/2001:23:57:18 中国标准时间] "GET /javascripts/prototype.js
HTTP/1.1" 200 125605
http://localhost:3000 -> /javascripts/prototype.js
127.0.0.1 - - [21/Dec/2001:23:57:19 中国标准时间] "GET /javascripts/effects.js H
TTP/1.1" 200 38916
http://localhost:3000 -> /javascripts/effects.js
127.0.0.1 - - [21/Dec/2001:23:57:19 中国标准时间] "GET /images/rails.png HTTP/1.
1" 200 1787
http://localhost:3000 -> /images/rails.png

进入成功页面,提示
Ruby on Rails: Welcome aboard .....

说明已经建立成功 恭喜你!


在DOS控制台中 Ctrl + c 可是终止 WEBrick 服务器的运行
[2001-12-21 23:59:20] INFO going to shutdown ...
[2001-12-21 23:59:20] INFO WEBrick::HTTPServer#start done.

但是我有一次出现了如下的情况:

进入 script 的目录下
D:\work\demo>cd script

查看了一下目录下的内容
D:\work\demo\script>dir
驱动器 D 中的卷没有标签。
卷的序列号是 DCFD-593C

D:\work\demo\script 的目录

2001-12-21 23:52 <DIR> .
2001-12-21 23:52 <DIR> ..
2001-12-21 23:52 <DIR> performance
2001-12-21 23:52 <DIR> process
2001-12-21 23:52 96 about
2001-12-21 23:52 98 console
2001-12-21 23:52 98 destroy
2001-12-21 23:52 99 generate
2001-12-21 23:52 97 runner
2001-12-21 23:52 97 server
2001-12-21 23:52 97 plugin
7 个文件 682 字节
4 个目录 10,005,307,392 可用字节

(我想直接运行这个WEBrick服务器,结果出错了,忘记加 ruby 了!)
D:\work\demo\script>server
'server' 不是内部或外部命令,也不是可运行的程序
或批处理文件。

(加上 ruby 以后 再运行)
D:\work\demo\script>ruby server
=> Booting WEBrick...
=> Rails application started on http://0.0.0.0:3000
=> Ctrl-C to shutdown server; call with --help for options
[2001-12-21 23:59:59] INFO WEBrick 1.3.1
[2001-12-21 23:59:59] INFO ruby 1.8.6 (2007-09-24) [i386-mswin32]
[2001-12-21 23:59:59] INFO WEBrick::HTTPServer#start: pid=3180 port=3000

再到 IE 浏览器中输入
http://localhost:3000/
没问题,一样的可以运行
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值