1

私はこれを機能させるために長い間試みてきましたが、成功しませんでした。私の oauth.yml ファイルでは、app_id と secret_id が Facebook アプリの設定と一致しています。未解決の構成の問題がある場合に備えて、サーバーを再起動しました。何が問題なのですか?

私は得続けます:

Given URL is not permitted by the application configuration.: One or more of the given URLs is not allowed by the App's settings. It must match the Website URL or Canvas URL, or the domain must be a subdomain of one of the App's domains

これは、私の Facebook アプリ設定のスクリーンショットです。 ここに画像の説明を入力

私の fb.init.html.erb ファイルは次のようになります。

<div id="fb-root"></div>
<script>
  window.fbAsyncInit = function() {
    // console.log("fbinit file");
    FB.init({
      appId      : '<%= OAUTH_CONFIG['facebook']['app_id'] %>',
      status     : true,
      cookie     : true,
      xfbml      : true,
      oauth      : true
    });
  };
  (function(d){
    // console.log("fbinit file2");
    var js, id = 'facebook-jssdk'; if (d.getElementById(id)) {return;}
    js = d.createElement('script'); js.id = id; js.async = true;
    js.src = "//connect.facebook.net/en_US/all.js";
    d.getElementsByTagName('head')[0].appendChild(js);
  }(document));
</script>

助けてくれてありがとう。

4

2 に答える 2

0

私の oauth.yml には次のものがありました。

development:
  facebook:  
    app_id: "3032327...etc"
    app_secret: "ebe99065439676ed...etc"
    options:
      scope: "email"
      display: "page"

staging: &staging
  facebook:
    app_id: "3782013...etc"
    app_secret: "4dabe290bd8ad7f815c54ad...etc"
    options:
      scope: "email"
      display: "page"

test:
  <<: *staging

production:
  facebook:
    app_id: "144574445...etc"
    app_secret: "501bf4e3202cd8578e322...etc"

だから私はすべての環境を同じように変更しました:

development:
  facebook:
    app_id: "14457444574...etc"
    app_secret: "501bf4e3202cd8578e322...etc"
    options:
      scope: "email"
      display: "page"

staging: &staging
  facebook:
    app_id: "1445744457...etc"
    app_secret: "501bf4e3202cd8578e3223...etc"
    options:
      scope: "email"
      display: "page"

test:
  <<: *staging

production:
  facebook:
    app_id: "1445744457...etc"
    app_secret: "501bf4e3202cd8578e3223...etc"

そして今、それは機能します。「ステージング」設定を使用しているのはなぜですか? これをどこで「本番」に変更できますか?

于 2013-07-19T09:00:37.260 に答える