【发布时间】:2016-11-20 12:51:01
【问题描述】:
我的 rails 应用正在使用 Devise。我添加了 devise_token_auth,以便我可以将应用程序链接到 android 应用程序。
在路线中
namespace :api do
scope :v1 do
#mount_devise_token_auth_for 'User', at: 'auth'
end
end
在初始化器中
# enable_standard_devise_support = false #for working with Devise
(除了文件中的其他代码)
我收到了这个错误
:~/workspace (master) $ rake db:migrate
-- [](4.2)
-- [](4.2)
rake aborted!
NoMethodError: undefined method `[]' for #<ActiveRecord::Migration:0x00000002c3c470>
解决方法,我删除修改了迁移文件
class DeviseTokenAuthCreateUsers < ActiveRecord::Migration[4.2]
到
class DeviseTokenAuthCreateUsers < ActiveRecord::Migration
我停止收到错误,但现在我收到了这个
StandardError: An error has occurred, this and all later migrations canceled:
SQLite3::SQLException: table "users" already exists: CREATE TABLE "users" ("id" IN ........
请帮忙,我怎样才能让它工作?
【问题讨论】:
标签: ruby-on-rails authentication devise token