Juggernaut & Rails
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,结束。
Posted in Ruby & Rails | 12 Comments | 789 views
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.
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.
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.
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.
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.
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.
SIMONRosario29 (Apr 25th 2012 at 02:09 PM)
Make your life more simple take the credit loans and all you need.
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.
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.
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.
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.
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.