新年第一推,快速创建rails3应用

来源:互联网 发布:libde265.js github 编辑:程序博客网 时间:2024/05/16 01:26

今天有空读了一篇Yehada Katz的博文, Spinning up a new Rails app。正好合适新年的第一推,所以上来发一下。
目的很明确,就是快速创建rails3项目,按如下操作即可:

Step 1: Check out Rails

$ git clone git://github.com/rails/rails.git

Step 2: Generate a new app

$ ruby rails/railties/bin/rails new_app

$ cd new_app

Step 3: Edit the app's Gemfile

# Add to the top directory "/path/to/rails", :glob => "{*/,}*.gemspec" git "git://github.com/rails/arel.git" git "git://github.com/rails/rack.git"

Step 4: Bundle

$ gem bundle

注意,这里需要先安装gem install bundler,才可以。

最后

Everything should now work: script/server, script/console, etc.如果实在想搞自动化的,需要脚本的朋友,可以看看这里



收工。祝新年好运!