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

Rails 5 - Missing template devise_token_auth/registrations/create #598

Closed
hoanghiep90 opened this issue Apr 3, 2016 · 3 comments
Closed

Comments

@hoanghiep90
Copy link

I used rails g devise_token_auth:install User auth so I have mount_devise_token_auth_for in my config/routes.rb. Like this

namespace :api, defaults: {format: 'json'} do
    scope :v1 do
      mount_devise_token_auth_for "User", at: 'auth'
    end
  end

My gem:

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 5.0.0.beta'
# Fix issues https://github.com/plataformatec/devise/issues/3736
gem 'devise', github: 'plataformatec/devise', branch: 'master'
gem 'omniauth', '>= 1.0.0'

# Token based authentication for Rails JSON APIs
gem 'devise_token_auth', github: 'lynndylanhurley/devise_token_auth', branch: 'master'

When I request: http://192.168.99.100:3000/api/v1/auth ( by POSTMAN )

I get an errors:

rb_1     | Started POST "/api/v1/auth" for 192.168.99.1 at 2016-04-03 15:55:18 +0000
rb_1     |   ActiveRecord::SchemaMigration Load (0.5ms)  SELECT "schema_migrations".* FROM "schema_migrations"
rb_1     | Processing by DeviseTokenAuth::RegistrationsController#create as JSON
rb_1     |   Parameters: {"email"=>"hiep.nguyen"}
rb_1     | Unpermitted parameter: format
rb_1     | Unpermitted parameter: format
rb_1     | Unpermitted parameter: format
rb_1     | Completed 500 Internal Server Error in 37ms (ActiveRecord: 2.1ms)
rb_1     | 
rb_1     | 
rb_1     | 
rb_1     | ActionView::MissingTemplate - Missing template devise_token_auth/registrations/create, devise_token_auth/application/create, devise/create, application/create with {:locale=>[:en], :formats=>[:json], :variants=>[], :handlers=>[:raw, :erb, :html, :builder, :ruby, :jbuilder]}. Searched in:
rb_1     |   * "/gems/gems/devise_token_auth-0.1.37/app/views"
rb_1     |   * "/gems/bundler/gems/devise-2b3799e6ceb3/app/views"

Does anyone have any idea?

@grantsprunger
Copy link

The problem seems to be caused by jbuilder. Changing the jbuilder gem source to the git master branch gem 'jbuilder', :git => 'git://github.com/rails/jbuilder.git' fixed the problem for me.

@tpetrone
Copy link

tpetrone commented Jun 19, 2016

@grantsprunger: Wish I had stumbled on this sooner.
Would you mind sharing HOW did you figure this out?
Thank you!

@zachfeldman
Copy link
Contributor

Seems like we have a proposed solution here, so closing for now.

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

4 participants