samedi 19 novembre 2022

Obstacle with Ruby Rails Authentication

I am a brand new Ruby on Rails User

When I enter localhost:3000 ,

I get an error reading

Migrations are pending. To resolve this issue, run: bin/rails db:migrate RAILS_ENV=development You have 2 pending migrations: 20221119205559_add_devise_to_users.rb 20221119211811_drop_users_table.rb

# Raises <tt>ActiveRecord::PendingMigrationError</tt> error if any migrations are pending.
      def check_pending!(connection = Base.connection)
        raise ActiveRecord::PendingMigrationError if connection.migration_context.needs_migration?
      end

      def load_schema_if_pending!

In a nutshell, it was working before but I attempted to create a a basic authentication page(which was also working) , but for some reason when I clicked sign up I received an error also.

Thank you for any tips on how to fix this!

I have tried to

rake db:drop
rake db:create
rake db:migrate

Editing the migrate file with: 

 edit your migration file

class DropUsersTable < ActiveRecord::Migration
  def change
    drop_table :users
  end
end

Then doing rake db:migrate

Also, I have run :


rails generate devise:install rails generate devise User bundle exec rake db:migrate



Aucun commentaire:

Enregistrer un commentaire