1
我的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 ........
請幫幫忙,我怎麼能讓這個工作?