Pages

Wednesday, 22 January 2014

在linux vps上搭建基于rubyonrails的博客程序-SpaceonRails

Space on Rails blog is a simple RubyonRails project to illustrate how to pass from a fat-server approach to a client based application.

Installation

Clone the repository and enter the directory:
$ git clone https://github.com/lodr/spaceonrails
$ cd spaceonrails
Install Ruby dependencies (you'll need bundler):
$ bundle install
Populate the database:
$ rake db:migrate
$ rake db:seed
Start the server:
$ nohup rails server > /dev/null & (默认使用的端口为3000.如果你的3000端口已被某个程序占用,
可指定运行的 端口:
 nohup rails server --port=3009 > /dev/null &
或者简写为:
nohup rails s --port=3009 > /dev/null &也可。
 
演示站点:http://as3.brite.biz:3009,还不知如何登录以及设置登录帐号

Project stages

The git project has X tags matching the different stages of the project:
  1. v0-plain is the starting point. All the navigation is handled by the rails application and not even CSS has been applied yet.
  2. v1-css is a little evolution over the starting point. Some advanced CSS has been applied but the navigation continues being synchronous and template driven via server *.erb files.
  3. v2.1-router starts the web application providing the webapp folder as well as the skeleton for the router module (webapp/js/router.js).
  4. v2.2-template continues with the web application by providing the skeleton for the template processor (webapp/js/template.js), a little software to manipulate the DOM.
  5. v2.3-webservice introduces the final stage of the web application and provide the skeleton for the different controllers for each blog section (webapp/js/controllers/). Each controller will modify the model by using a REST API provided by the server in rails.
  6. v3-testsuite adds the test suite required to validate our architecture.
  7. v4-done implements the architecture and passes the test suite.
NOTE: At this moment, only v0-plain, v1-css and v2.1-router are available.
Changing from one to another is as simple as making check out of the tag. I.e.:
$ git checkout v1-css
It is recommended to start a new branch while following the course so you can make:
$ git checkout v0-plain
$ git checkout -b my-branch-from-v0
Don't try to follow the story of the repository because it is likely to change and being reorganized. The only purpose of tags is to provide different snapshots to work from.

项目地址:https://github.com/lodr/spaceonrails
相关帖子:
http://briteming.blogspot.co.uk/2013/12/linux-vpsrubymysqlrobbinsite.html
http://briteming.blogspot.co.uk/2014/01/linux-vpsruby-obtvse2.html
http://briteming.blogspot.co.uk/2013/12/linux-vpsrubyrails-blogcast.html