[Ruby] rake db:migrate で ArgumentError: Unknown validator: ‘UniqunessValidator’

less than 1 minute read

During development at sinatra, with reke db:migrate Cause and action when ArgumentError: Unknown validator:'UniqunessValidator' appears

solution

uniqnessvlidator? I don’t know that! I am writing I deleted the validation I wrote previously for the corresponding model!

user.rb


class User <ActiveRecord::Base
# validates :email, presence: true, length: {maximum: 255 },
# format: {with: /\A[\w+\-.][email protected][a-z\d\-.]+\.[a-z]+\z/i },
# uniquness: {case_sensitive: false}
# has_secure_password
end

Now you can run rake db:migrate and it will be migrated!

If you look closely,

The uniqueness e is missing! !! !!

user.rb



     uniquness: {case_sensitive: false}

Be careful of typos…