Elvuel

善战者无赫赫之功

  • Home
  • Atom
  • About Elvuel

Juggernaut & Rails

Posted on August 30th, 2011 - 农历辛卯[兔]年 八月初二

Juggernaut https://github.com/maccman/juggernaut

安装配置

1. nodejs http://nodejs.org

获取 0.4.11稳定版

以下: sudo

wget http://nodejs.org/dist/node-v0.4.11.tar.gz

>tar zxvf node-v0.4.11.tar.gz

>cd node-v0.4.11

>./configure

>make

>make install

 

2. npm(需NODEJS 0.4以上版本)

以下: sudo

curl http://npmjs.org/install.sh | sh

 

安装模块

    >npm install socket.io

    >npm install redis

    >npm install optimist

    >npm install node-static-maccman

 

 

3. 安装并启动redis-server

>redis-server /etc/redis/redis.conf

4. 启动 juggernaut

>git clone https://github.com/maccman/juggernaut.git

>cd juggernaut

>node server.js

 

4. 创建RAILS应用

>rails new juggernaut_demo

>cd juggernaut_demo

vim Gemfile:

       gem 'juggernaut'

>bundle install

>rails g controller welcome index publish

vim routes.rb

       root :to => "welcome#index"

       get "welcome#publish"

vim application.html.erb

      <script src="http://localhost:8080/application.js" type="text/javascript" charset="utf-8"></script>

 

vim welcome#index.html.erb

<script type="text/javascript" charset="utf-8"> var jug = new Juggernaut; jug.subscribe("demo_channel", function(data){   alert(data); }); </script>

 

vim welcome_controller#publish

def publish

Juggernaut.publish "demo_channel", "juggernaut demo msg"

end

 

>rails s

访问: http://localhost:3000/

        http://localhost:3000/welcome/publish

Ok,结束。


Tags: juggernaut rails

Posted in Ruby & Rails   |   12 Comments   |  789 views

Comments

12楼

ALYCEHammond   (May 13th 2012 at 12:44 AM)

I had to write a lot of various essay, such as art essays, but I did not have enough qualifications for those assignments.

11楼

RosalindaFletcher   (May 9th 2012 at 09:57 AM)

We will say that you make really very superb note about this good post. You should finish the thesis samples for buy thesis services or make our own dissertation writing service and some men would buy theses in that location.

10楼

CruzAngeline28   (May 8th 2012 at 05:30 AM)

Our custom thesis is perfect but we thank you for the perfect topic as this post. So, after this some students really get know just about dissertation and buy term paper.

9楼

AmberMcmahon   (May 5th 2012 at 06:40 AM)

The Architecture Essay composing trainings will aid you improve your skills that can be used for future career.

8楼

SpenceEarlene   (May 2nd 2012 at 01:57 AM)

I opine that you have to give the advices just about computer science dissertation connected with this post writing. Because some people do not know the way to do it and still utilize a help of the thesis writing service.

7楼

LuciaFlowers   (Apr 28th 2012 at 01:56 PM)

Very often to get your Academic degree you must purchase thesis summary about this good post and dissertation.

6楼

SIMONRosario29   (Apr 25th 2012 at 02:09 PM)

Make your life more simple take the credit loans and all you need.

5楼

SherylWard22   (Apr 21st 2012 at 04:59 PM)

Do you envy your group mates because they have got superior research papers? Did you opine they could ask paper writing companies help them? Actually, you can easily do so too.

4楼

ClaudetteHull27   (Apr 18th 2012 at 08:05 AM)

Very sensational exposition. With content being so decisive online, this is a admirable outline for creating new on that people will use for thesis writing.

3楼

CherieFOWLER32   (Apr 9th 2012 at 10:47 AM)

Do you opine it is a piece of cake to check your content? It will be more difficult than you guess. Moreover, you should definitely utilize plagiarism checker to be sure that all is good with your papers.

2楼

Lola29Cobb   (Mar 21st 2012 at 12:43 AM)

The dissertation writing service will offer scholars with the french dissertation but the really good topic about this topic students should notice on this page only.

1楼

DawnManning19   (Mar 17th 2012 at 10:19 PM)

Gossips that the seo package service can be addressable are definitely untrue. Link building corporations take seo orders requested by various guys.

Post your comment


*
*(not shown)
Click,change verify code.


  • Search

  • Categories

    • Ruby & Rails
    • Jobs
    • Uncategorized
  • Recent Posts

    • Prawn使用Annotation坐...
    • ejabberd mod_archive
    • Capybara get session in ...
    • Juggernaut & Rails
    • RottenEgg发布
    • ruby rmagick 生成DM
    • ActiveResource for no r...
    • Rails生成Model文档
    • 转-Method triggers:inst...
    • 招聘-Ruby on Rails软件...
  • Links

    • RailsCasts
    • The Ruby Reflector
    • Alltop Ruby
    • Command Line Refer
    • Ruby Code Snippets
    • GitHub
    • API Dock
    • OpenSourceRails
    • RailsPlugins
    • RailsLab
    • 15DaysOfJQuery
  • Archives

    • 2012年(1)

    • 2012年01月(1)
    • 2011年(10)

    • 2011年12月(1)
    • 2011年11月(1)
    • 2011年08月(2)
    • 2011年04月(2)
    • 2011年03月(1)
    • 2011年01月(3)
    • 2010年(27)

    • 2010年12月(1)
    • 2010年11月(2)
    • 2010年10月(4)
    • 2010年09月(7)
    • 2010年08月(1)
    • 2010年07月(5)
    • 2010年06月(1)
    • 2010年04月(6)
    • 2009年(13)

    • 2009年10月(1)
    • 2009年05月(2)
    • 2009年04月(1)
    • 2009年03月(2)
    • 2009年02月(7)
    • 2008年(19)

    • 2008年08月(1)
    • 2008年07月(1)
    • 2008年06月(1)
    • 2008年05月(3)
    • 2008年04月(1)
    • 2008年03月(2)
    • 2008年02月(10)

Copyright © 2010 elvuel.com Powered by Elvuel.