推送器聊天示例错误

时间:2012-01-27 08:25:30

标签: ruby-on-rails ruby-on-rails-3 api chat nomethoderror

我正在尝试使用tarnfeld的PusharChat-Rails

我下载了该文件,通常bundle install& db:migrate

我在PusherChat-Rails / app / views / layouts / application.html.erb中更改了api键

但我收到此错误

NoMethodError in Chat#view

Showing /Users/gkolan/work/PusherChat/app/views/chat/view.html.erb where line #22 raised:

undefined method `auto_link_urls' for #<#<Class:0x007fdddb772818>:0x007fdddb710230>

Extracted source (around line #22):

19:     <ul id="messages">
20:         <% @messages.each do |message| %>
21:             <% user = ChatUser.find(message.user_id) %>
22:             <li<% if user.id == @user.id %> class="you"<% end %>><strong><%= user.nickname %></strong> said:<br><%= auto_link_urls(message.message, { :target => "_blank" }) %></li>
23:         <% end %>
24:     </ul>
25:     <div id="message-overlay"></div>

Rails.root: /Users/gkolan/work/PusherChat

我认为这是一个非常简单的错误。你能帮我解决一下吗?

提前致谢!

1 个答案:

答案 0 :(得分:1)

对于rails&gt; = 3.1.0已弃用auto_link_urls方法。

你可以:

  • 修改您的Gemfile以使用3.0.9
  • rails_autolink gem添加到您的Gemfile