i have deployed an app to heroku(finance tracker under "ROR developer course" from udemy.com). The login button works fine but when i click on the signup button, it gives me this error
We're sorry, but something went wrong.
If you are the application owner check the logs for more information.
I have ran heroku run rake db:migrate successfully. I used devise gem for authentication. Pls any idea someone??....thanks
Edit
From log:
2016-10-26T17:46:19.965045+00:00 heroku[router]: at=info method=GET path="/users/sign_up" host=johnuzoma-finance-tracker.herokuapp.com request_id=9b928dfe-66be-47b5-933b-3d5b6cf3a899 fwd="197.210.25.210" dyno=web.1 connect=0ms service=19ms status=500 bytes=1754
2016-10-26T17:46:19.950321+00:00 app[web.1]: Started GET "/users/sign_up" for 197.210.25.210 at 2016-10-26 17:46:19 +0000
2016-10-26T17:46:19.955368+00:00 app[web.1]: Processing by User::RegistrationsController#new as HTML
2016-10-26T17:46:19.957892+00:00 app[web.1]: Completed 500 Internal Server Error in 2ms (ActiveRecord: 0.0ms)
2016-10-26T17:46:19.958887+00:00 app[web.1]:
2016-10-26T17:46:19.958889+00:00 app[web.1]: NoMethodError (undefined method `for' for #<Devise::ParameterSanitizer:0x007f782dff6408>):
2016-10-26T17:46:19.958890+00:00 app[web.1]: app/controllers/user/registrations_controller.rb:7:in `configure_permitted_parameters'
2016-10-26T17:46:19.958891+00:00 app[web.1]:
2016-10-26T17:46:19.958892+00:00 app[web.1]:
2016-10-26T17:46:20.651597+00:00 heroku[router]: at=info method=GET path="/favicon.ico" host=johnuzoma-finance-tracker.herokuapp.com request_id=8d875ac1-de78-47 68-9cd0-a653afd2318b fwd="197.210.25.210" dyno=web.1 connect=0ms service=6ms status=304 bytes=133
RegistrationsController code
class User::RegistrationsController < Devise::RegistrationsController
before_filter :configure_permitted_parameters
protected
def configure_permitted_parameters
devise_parameter_sanitizer.for(:sign_up).push(:first_name, :last_name)
devise_parameter_sanitizer.for(:account_update).push(:first_name, :last_name)
end
end
So the first thing you should do is go to the Heroku admin panel for your app and look through the log file. You should find a stack trace (should look like an error followed by a bunch of method calls and line numbers). Another option is for you to remotely access the app server, go to you Heroku app directory on your computer and run (assuming you have Heroku CLI installed)
heroku run bash
then navigate to your log directory and run
tail -f <replace_with_log_file_name>
(log file should be production.log or develop.log) and that will show you a real time stream of the log activity, so just go recreate the bug and see what happens.
Replace these lines
def configure_permitted_parameters
devise_parameter_sanitizer.for(:sign_up).push(:first_name, :last_name)
devise_parameter_sanitizer.for(:account_update).push(:first_name, :last_name)
end
With these lines
def configure_permitted_parameters
devise_parameter_sanitizer.permit(:sign_up, keys: [:first_name, :last_name])
devise_parameter_sanitizer.permit(:account_update, keys: [:first_name, :last_name])
end
What happened is the gem devise that you are using changed its API in version for so the syntax you are were using is no longer valid. I am assuming that at some point in time you did a bundle update or something that inadvertently upgraded you gem
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With