1

これが私のapplication.jsファイルです

//= require jquery
//= require jquery_ujs
//= require foundation
//= require private_pub
//= require_tree .

私の private_pub.ru ファイル

development:
  server: "http://localhost:9292/tweets/create"
  secret_token: "secret"
test:
  server: "http://localhost:9292/tweets/create"
  secret_token: "secret"
production:
  server: "http://localhost:9292/tweets/create"
  secret_token: "89e004720af45e61a350a30cf7ee3f50163ca141a02ea130db0b5007a0b75058"
  signature_expiration: 3600 # one hour

マイページのチャンネル登録したい部分

<%= form_for @tweet, url: tweets_path, method: :post, remote: true do |f| %>
<%= f.text_area :body, id: 'tweet-box', placeholder: "What's goin on..." %>
<%= f.submit 'tweet', id: 'tweet-btn', class: 'button' %>
<% end %>
<div id="map-canvas" />
<%= subscribe_to '/'tweets/create' %>

ツイート コントローラーの create アクションの create.js.erb ファイル

<% publish_to "/tweets/create" do %>
var swBound_tweet = new google.maps.LatLng(<%= @tweet.location.latitude %>,<%=          @tweet.location.longitude %>)
var neBound_tweet = new google.maps.LatLng(<%= @tweet.location.latitude %>,<%= @tweet.location.longitude %>)
var tweet_coords = new google.maps.LatLngBounds(swBound_tweet, neBound_tweet)
var tweet_overlay = new Tweet(tweet_coords,"<%= @tweet.body %>", window.map)
<% end %>

これでfayeサーバーを起動しました:

bundle exec rackup private_pub.ru -s thin -E development config.ru

も試してみました

bundle exec rackup private_pub.ru -s thin -E production config.ru

ブラウザ コンソールに次のエラーが表示されます。

GET http://localhost:9292/tweets/create.js 404 (Not Found)

faye サーバー ログに次のエラーが表示されます。

127.0.0.1 - - [25/Jan/2014 11:16:56] "GET /tweets/create.js HTTP/1.1" 404 767 0.1431

言及されているすべてのファイルでチャネル名を数回変更しましたが、それでも同じ問題が発生します。私は使用しています:

ruby - 2.0.0
rails - 3.2.13
faye - 1.0.1
private_pub - 1.0.3

インターネット全体を検索しましたが、何も見つかりませんでした。助けてください!

4

1 に答える 1