Agile Web Development with Rails depot例程 建立application
Posted on 2008-10-29 11:43 noAh.... 阅读(496) 评论(0) 收藏 举报我们在D盘下面的rails文件夹里面建立例程。
在这个例程中,我们将建立一个网络书店的WebSite。在这里boss(我们)可以添加进数据信息,用户可以浏览书籍,将之“扔”进购物车,结账。
右键D盘的rails文件夹,进入命令提示符,输入 >rails depot -d mysql
D:\rails>rails depot -d mysql
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/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 config/initializers/inflections.rb
create config/initializers/mime_types.rb
create config/initializers/new_rails_defaults.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/dbconsole
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:\rails>
Rails会自动建立depot文件夹,然后在其下面生成一系列的文件夹及其他文件。
-d mysql代表我们将使用MySQL做为我们的数据库服务器。
进入depot文件夹,输入 >ruby script/server 我们便已经启动了Web服务器。
D:\rails>cd depot
D:\rails\depot>ruby script/server
=> Booting WEBrick...
=> Rails 2.1.2 application started on http://0.0.0.0:3000
=> Ctrl-C to shutdown server; call with --help for options
[2008-10-29 11:30:27] INFO WEBrick 1.3.1
[2008-10-29 11:30:27] INFO ruby 1.8.6 (2007-09-24) [i386-mswin32]
[2008-10-29 11:30:28] INFO WEBrick::HTTPServer#start: pid=3272 port=3000
这个时候我们已经可以通过http://localhost:3000访问我们建立的WebSite了,很简单是吧?
虽然我们仅仅输入了几行命令,得到的也只是一个rails默认页面。但是至少证明了我们的配置环境是正确的,也就是说,万事开头难的第一步已经完美的迈出了!