ruby on rails - ActionView::Template::Error (Failed to open TCP connection to localhost:9292 (Connection refused - connect(2) for "localhost" port 9292)) -


please give me solution following error.

this chat application.... , code , error follows::

conversations_controller.rb

def create     if conversation.between(params[:sender_id],params[:recipient_id]).present?       @conversation = conversation.between(params[:sender_id],params[:recipient_id]).first     else       @conversation = conversation.create!(conversation_params)     end     render json: { conversation_id: @conversation.id }   end 

create.js.erb

<% publish_to @path %>         alert(@path);            var id = "<%= @conversation.id %>";     var chatbox = $("#chatbox_" + id + " .chatboxcontent");     var sender_id = "<%= @message.user.id %>";     var reciever_id = $('meta[name=user-id]').attr("content");      chatbox.append("<%= j render( partial: @message ) %>");     chatbox.scrolltop(chatbox[0].scrollheight);      if (sender_id != reciever_id) {         chatbox.chatwith(id);         chatbox.children().last().removeclass("self").addclass("other");         chatbox.scrolltop(chatbox[0].scrollheight);         chatbox.notify();     } <% end %> 

error shown on console:

actionview::template::error (failed open tcp connection localhost:9292 (connection refused - connect(2) "localhost" port 9292)):     1: <% publish_to @path %>     2:      alert(@path);            3:     var id = "<%= @conversation.id %>";     4:     var chatbox = $("#chatbox_" + id + " .chatboxcontent");   app/views/messages/create.js.erb:1:in `_app_views_messages_create_js_erb___1855030059461646481_70563200' 

please give solution issue.

thanks in advance.

it looks using private_pub gem. requires startup separate rack server.

rackup private_pub.ru -s thin -e production 

did that?


Comments

Popular posts from this blog

sql - invalid in the select list because it is not contained in either an aggregate function -

Angularjs unit testing - ng-disabled not working when adding text to textarea -

How to start daemon on android by adb -