I be able to see the output in heroku by fixing errors in Gemfile

[Errors in Gemfile](https://stackoverflow.com/questions/45228434/errors-in-gemfile)

Also I could login as admin...but only one time...then my password is not recognized and login 
is not successful...
I could not save my password on admin page(error:Password doesn't match confirmation) and could not login 
using admin password provided(error:Login unsuccessful)

I've tried to create admin and password manually but got errors. 

How to login using admin credential?

thanks

Errors and files related as below

//errors

```
typo-1 (master) $ rails console
Loading development environment (Rails 3.0.17)
1.9.3-p551 :001 > User.create(:username => 'admin', 
1.9.3-p551 :002 >       :password => 'abc123', 
1.9.3-p551 :003 >       :password_confirmation => 'abc123') 
ActiveRecord::UnknownAttributeError: unknown attribute: username
        from /usr/local/rvm/gems/ruby-1.9.3-p551/gems/activerecord-3.0.17/lib/active_record/base.rb:1565:in `block in attributes='
        from /usr/local/rvm/gems/ruby-1.9.3-p551/gems/activerecord-3.0.17/lib/active_record/base.rb:1561:in `each'
        from /usr/local/rvm/gems/ruby-1.9.3-p551/gems/activerecord-3.0.17/lib/active_record/base.rb:1561:in `attributes='
        from /usr/local/rvm/gems/ruby-1.9.3-p551/gems/activerecord-3.0.17/lib/active_record/base.rb:1412:in `initialize'
        from /home/ubuntu/workspace/typo-1/app/models/user.rb:53:in `initialize'
        from /usr/local/rvm/gems/ruby-1.9.3-p551/gems/activerecord-3.0.17/lib/active_record/base.rb:502:in `new'
        from /usr/local/rvm/gems/ruby-1.9.3-p551/gems/activerecord-3.0.17/lib/active_record/base.rb:502:in `create'
        from (irb):1
        from /usr/local/rvm/gems/ruby-1.9.3-p551/gems/railties-3.0.17/lib/rails/commands/console.rb:44:in `start'
        from /usr/local/rvm/gems/ruby-1.9.3-p551/gems/railties-3.0.17/lib/rails/commands/console.rb:8:in `start'
        from /usr/local/rvm/gems/ruby-1.9.3-p551/gems/railties-3.0.17/lib/rails/commands.rb:23:in `<top (required)>'
        from script/rails:6:in `require'
        from script/rails:6:in `<main>'
1.9.3-p551 :004 > User.create(:username => 'admin',                                                                
1.9.3-p551 :005 >       :password_confirmation => 'abc123')                                                        
ActiveRecord::UnknownAttributeError: unknown attribute: username
        from /usr/local/rvm/gems/ruby-1.9.3-p551/gems/activerecord-3.0.17/lib/active_record/base.rb:1565:in `block in attributes='
        from /usr/local/rvm/gems/ruby-1.9.3-p551/gems/activerecord-3.0.17/lib/active_record/base.rb:1561:in `each'
        from /usr/local/rvm/gems/ruby-1.9.3-p551/gems/activerecord-3.0.17/lib/active_record/base.rb:1561:in `attributes='
        from /usr/local/rvm/gems/ruby-1.9.3-p551/gems/activerecord-3.0.17/lib/active_record/base.rb:1412:in `initialize'
        from /home/ubuntu/workspace/typo-1/app/models/user.rb:53:in `initialize'
        from /usr/local/rvm/gems/ruby-1.9.3-p551/gems/activerecord-3.0.17/lib/active_record/base.rb:502:in `new'
        from /usr/local/rvm/gems/ruby-1.9.3-p551/gems/activerecord-3.0.17/lib/active_record/base.rb:502:in `create'
        from (irb):4
        from /usr/local/rvm/gems/ruby-1.9.3-p551/gems/railties-3.0.17/lib/rails/commands/console.rb:44:in `start'
        from /usr/local/rvm/gems/ruby-1.9.3-p551/gems/railties-3.0.17/lib/rails/commands/console.rb:8:in `start'
        from /usr/local/rvm/gems/ruby-1.9.3-p551/gems/railties-3.0.17/lib/rails/commands.rb:23:in `<top (required)>'
        from script/rails:6:in `require'
        from script/rails:6:in `<main>'
1.9.3-p551 :006 > 

```

//controllers/admin/users\_controller.rb

```
    class Admin::UsersController < Admin::BaseController
      cache_sweeper :blog_sweeper

      def index
        @users = User.order('login asc').page(params[:page]).per(this_blog.admin_display_elements)
      end

      def new
        @user = User.new
        @user.attributes = params[:user]
        @user.text_filter = TextFilter.find_by_name(this_blog.text_filter)
        setup_profiles
        @user.name = @user.login
        if request.post? and @user.save
          flash[:notice] = _('User was successfully created.')
          redirect_to :action => 'index'
        end
      end

    def edit
        @user = params[:id] ? User.find_by_id(params[:id]) : current_user

        setup_profiles
        @user.attributes = params[:user]
        if request.post? and @user.save
          if @user.id = current_user.id
            current_user = @user
          end

        flash[:notice] = _('User was successfully updated.')
              redirect_to :action => 'index'
        end
      end

      def destroy
        @record = User.find(params[:id])
        return(render 'admin/shared/destroy') unless request.post?

        @record.destroy if User.count > 1
        redirect_to :action => 'index'
      end

      private

      def setup_profiles
        @profiles = Profile.find(:all, :order => 'id')
      end
    end

```

//models/user.rb

```
    require 'digest/sha1'

    # Typo user.
    class User < ActiveRecord::Base
      include ConfigManager

      belongs_to :profile
      belongs_to :text_filter

     delegate :name, :to => :text_filter, :prefix => true
      delegate :label, :to => :profile, :prefix => true

      has_many :notifications, :foreign_key => 'notify_user_id'
      has_many :notify_contents, :through => :notifications,
        :source => 'notify_content',
        :uniq => true

      has_many :articles, :order => 'created_at DESC'

    serialize :settings, Hash

      # Settings
      setting :notify_watch_my_articles,   :boolean, true
      setting :editor,                     :string, 'visual'
      setting :firstname,                  :string, ''
      setting :lastname,                   :string, ''
      setting :nickname,                   :string, ''

    setting :description,                :string, ''
      setting :url,                        :string, ''
      setting :msn,                        :string, ''
      setting :aim,                        :string, ''
      setting :yahoo,                      :string, ''
      setting :twitter,                    :string, ''
      setting :jabber,                     :string, ''
      setting :show_url,                   :boolean, false
      setting :show_msn,                   :boolean, false
      setting :show_aim,                   :boolean, false
      setting :show_yahoo,                 :boolean, false

    setting :show_twitter,               :boolean, false
      setting :show_jabber,                :boolean, false
      setting :admin_theme,                :string,  'blue'

      # echo "typo" | sha1sum -
      class_attribute :salt

      def self.salt
        '20ac4d290c2293702c64b3b287ae5ea79b26a5c1'
      end

    attr_accessor :last_venue

      def initialize(*args)
        super
        self.settings ||= {}
      end

      def self.authenticate(login, pass)
        find(:first,

        :conditions => ["login = ? AND password = ? AND state = ?", login, password_hash(pass), 'active'])
      end

      def update_connection_time
        self.last_venue = last_connection
        self.last_connection = Time.now
        self.save
      end

    # These create and unset the fields required for remembering users between browser closes
      def remember_me
        remember_me_for 2.weeks
      end

      def remember_me_for(time)
        remember_me_until time.from_now.utc
      end

      def remember_me_until(time)
        self.remember_token_expires_at = time
        self.remember_token            = Digest::SHA1.hexdigest("#{email}--#{remember_token_expires_at}")
        save(:validate => false)
      end

      def forget_me
        self.remember_token_expires_at = nil
        self.remember_token            = nil
        save(:validate => false)
      end

      def permalink_url(anchor=nil, only_path=false)
        blog = Blog.default # remove me...

        blog.url_for(
          :controller => 'authors',

         :action => 'show',
          :id => login,
          :only_path => only_path
        )
      end

      def self.authenticate?(login, pass)
        user = self.authenticate(login, pass)
        return false if user.nil?
        return true if user.login == login

     false
      end

      def self.find_by_permalink(permalink)
        self.find_by_login(permalink).tap do |user|
          raise ActiveRecord::RecordNotFound unless user
        end
      end

      def project_modules
        profile.project_modules
      end

      # Generate Methods takes from AccessControl rules
      # Example:
      #
      #   def publisher?
      #     profile.label == :publisher
      #   end

    AccessControl.roles.each do |role|
        define_method "#{role.to_s.downcase}?" do
          profile.label.to_s.downcase == role.to_s.downcase
        end
      end

    def self.to_prefix
        'author'
      end

      def simple_editor?
        editor == 'simple'

    end

      def password=(newpass)
        @password = newpass
      end

    def password(cleartext = nil)
        if cleartext
          @password.to_s
        else
          @password || read_attribute("password")

     end
      end

      def article_counter
        articles.size

  end

def display_name
    name
  end

  def permalink
    login
  end

  def to_param
    permalink
  end

  def admin?
    profile.label == Profile::ADMIN
  end

  protected

  # Apply SHA1 encryption to the supplied password.
  # We will additionally surround the password with a salt
  # for additional security.
  def self.password_hash(pass)
    Digest::SHA1.hexdigest("#{salt}--#{pass}--")
  end

  def password_hash(pass)
    self.class.password_hash(pass)
  end

  before_create :crypt_password

  # Before saving the record to database we will crypt the password
  # using SHA1.
  # We never store the actual password in the DB.
  # But before the encryption, we send an email to user for he can remind his
  # password
  def crypt_password
    send_create_notification
    write_attribute "password", password_hash(password(true))
    @password = nil
  end

  before_update :crypt_unless_empty

  # If the record is updated we will check if the password is empty.
  # If its empty we assume that the user didn't want to change his
  # password and just reset it to the old value.
  def crypt_unless_empty
    if password(true).empty?
      user = self.class.find(self.id)
      write_attribute "password", user.password
    else
      crypt_password
    end
  end

  before_validation :set_default_profile

  def set_default_profile
    if User.count.zero?
      self.profile ||= Profile.find_by_label('admin')
    else
      self.profile ||= Profile.find_by_label('contributor')
    end
  end

  validates_uniqueness_of :login, :on => :create
  validates_uniqueness_of :email, :on => :create
  validates_length_of :password, :within => 5..40, :if => Proc.new { |user|
    user.read_attribute('password').nil? or user.password.to_s.length > 0
  }

  validates_presence_of :login
  validates_presence_of :email

  validates_confirmation_of :password
  validates_length_of :login, :within => 3..40

  private

  # Send a mail of creation user to the user create
  def send_create_notification
    begin
      email_notification = NotificationMailer.notif_user(self)
      EmailNotify.send_message(self, email_notification)
    rescue => err
      logger.error "Unable to send notification of create user email: #{err.inspect}"
    end
  end
end

```

//editing: replacement user\_id to login

```
$ rails console
Loading development environment (Rails 3.0.17)
1.9.3-p551 :001 > User.create(login: 'admin', password: 'password123', password_confirmation: 'password123')
 => #<User id: nil, login: "admin", password: nil, email: nil, name: nil, notify_via_email: nil, notify_on_new_articles: nil, notify_on_comments: nil, profile_id: 3, remember_token: nil, remember_token_expires_at: nil, text_filter_id: "1", state: "active", last_connection: nil, settings: {}> 
1.9.3-p551 :002 > exit

```