Devise error: email can't be blank

Found what the error is. I use strong parameters and that causes an error. More at https://github.com/plataformatec/devise#strong-parameters

So the solution is to add this into your application_controller.rb

# Rails 3.x.x and older
before_filter :configure_permitted_parameters, if: :devise_controller?

# Rails 4.x.x and newer
before_action :configure_permitted_parameters, if: :devise_controller?

def configure_permitted_parameters
  devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(:username, :email, :password, :password_confirmation) }
end

Keep in mind to configure for each action like :sign_in, :sign_up, :account_update etc.