Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NoMethodError - undefined method `push' #159

Open
soramugi opened this issue Sep 2, 2015 · 0 comments
Open

NoMethodError - undefined method `push' #159

soramugi opened this issue Sep 2, 2015 · 0 comments

Comments

@soramugi
Copy link
Contributor

soramugi commented Sep 2, 2015

googleの認証トークンの設定でGoogle+ APIを有効にしてないと内部エラーのページが表示されます

Started GET "/users/sign_in" for 127.0.0.1 at 2015-09-02 15:18:50 +0900
Processing by Devise::SessionsController#new as HTML
Completed 500 Internal Server Error in 2ms

NoMethodError - undefined method `push' for #<String:0x007fec86e285b8>:
  gritter (1.1.0) lib/gritter/gflash.rb:58:in `gflash_push'
  gritter (1.1.0) lib/gritter/gflash.rb:38:in `block in gflash'
  gritter (1.1.0) lib/gritter/gflash.rb:28:in `gflash'
  app/controllers/application_controller.rb:13:in `redirect_unless_signed_in'
  activesupport (4.1.8) lib/active_support/callbacks.rb:424:in `block in make_lambda'
  activesupport (4.1.8) lib/active_support/callbacks.rb:160:in `block in halting'
  activesupport (4.1.8) lib/active_support/callbacks.rb:166:in `block in halting'
  activesupport (4.1.8) lib/active_support/callbacks.rb:229:in `block in halting'

flash[:alert]に文字列が入っているのにapplication_controller.rbファイル内のgflash alert: 'You need Login!'で配列を入れようとしているのが原因のエラーのようです。

flash[:alert] # "Could not authenticate you from GoogleOauth2 because \"Invalid credentials\"."

ちなみにapi認証エラーのログも出力されてました

Started GET "/users/auth/google_oauth2/callback?state=xxxxxxx&code=xxxxxxx" for 127.0.0.1 at 2015-09-02 15:22:17 +0900
I, [2015-09-02T15:22:26.076934 #14971]  INFO -- omniauth: (google_oauth2) Callback phase initiated.
E, [2015-09-02T15:22:26.781059 #14971] ERROR -- omniauth: (google_oauth2) Authentication failure! invalid_credentials: OAuth2::Error, {"errors"=>[{"domain"=>"usageLimits", "reason"=>"accessNotConfigured"
, "message"=>"Access Not Configured. The API (Google+ API) is not enabled for your project. Please use the Google Developers Console to update your configuration.", "extendedHelp"=>"https://console.devel
opers.google.com"}], "code"=>403, "message"=>"Access Not Configured. The API (Google+ API) is not enabled for your project. Please use the Google Developers Console to update your configuration."}: 
{
 "error": {
  "errors": [
   {
    "domain": "usageLimits",
    "reason": "accessNotConfigured",
    "message": "Access Not Configured. The API (Google+ API) is not enabled for your project. Please use the Google Developers Console to update your configuration.",
    "extendedHelp": "https://console.developers.google.com"
   }
  ],
  "code": 403,
  "message": "Access Not Configured. The API (Google+ API) is not enabled for your project. Please use the Google Developers Console to update your configuration."
 }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant