I’m developing a Rails App and am using Devise for authentication. For some odd reason, when my users sign up for the first time, it works perfectly fine, but after signing out and signing in again, the error “This website temporarily unavailable” pops up. This is really bizarre.
I am using the default Devise::SessionsController and the same create method for registration. Does anybody have any idea what’s happening? Thanks so much for any help.
In my Application Controller I have the function
def after_sign_in_path_for(resource)
root_path
end
To redirect after sign-ins. Besides this I am using all the default Devise code.
UPDATE:
The error message “Website temporarily unavailable” shows up sometimes after following the link from the email.
Here’s the code in the view:
<%= form_for(resource, :as => resource_name, :url => confirmation_path(resource_name), :html => { :method => :post }) do |f| %>
Could this be the source of the problem? Thanks a lot. Just as an aside I’m hosting on Heroku.
I checked the Heroku logs:
This is the result after registering:
Processing by RegistrationsController#create as HTML
2012-01-02T23:22:44+00:00 app[web.1]: Parameters: {"utf8"=>"✓", "authenticity_token"=>"brHjEOxwm4qhkuypmuIUohk0UVg+One8OUx6gsfvmgg=", "user {"email"=>"blah@blah.com", "name"=>"adsfasf", "password"=>"[FILTERED]", "password_confirmation"=>"[FILTERED]", "isartist"=>"0"}, "commit"=>"Sign up"}
2012-01-02T23:22:44+00:00 app[web.1]: Rendered devise/mailer/confirmation_instructions.html.erb (0.4ms)
2012-01-02T23:22:47+00:00 app[web.1]: Redirected to http://www.artinject.com/
2012-01-02T23:22:47+00:00 app[web.1]: Completed 302 Found in 2963ms
2012-01-02T23:22:47+00:00 app[web.1]: cache: [POST /users] invalidate, pass
And this is the result after sending the mail and clicking the confirmation link:
2012-01-02T23:22:47+00:00 app[web.1]: Sent mail to jw2896@barnard.edu (2755ms)
2012-01-02T23:22:47+00:00 app[web.1]: [paperclip] Saving attachments.
2012-01-02T23:22:47+00:00 heroku[router]: POST www.artinject.com/users dyno=web.1 queue=0 wait=0ms service=2982ms status=302 bytes=91
2012-01-02T23:22:47+00:00 app[web.1]:
2012-01-02T23:22:47+00:00 app[web.1]: Started GET "/" for 69.125.4.183 at 2012-01-02 23:22:47 +0000
Hopefully this helps. It doesn’t look like heroku is throwing an error, although it says “Website temporarily unavailable”
I realize now why this was such a mystery. It turns out that GoDaddy was not forwarding my url consistently–sometimes it would properly forward my url and then other times it didn’t. This explains why the Heroku logs were not throwing any errors.
Thanks for the responses everyone.