title: uninitialized constant ApplicationRecord error
body: <p>I am following the RailsTutorial and have been creating a Users model with appropriate attrs and validations. I've run into this error and cannot see where the problem is. The project is configured using Rails5, thus models inheriting from ApplicationRecord should be correct:</p>
  
  <p>User.rb:</p>
  
  <pre><code>class User &lt; ApplicationRecord
  
  before_save { self.email = email.downcase }
  validates   :name, presence: true, length: { maximum: 50 }
  
  VALID_EMAIL_REGEX = /\A([\w+\-].?)+@[a-z\d\-]+(\.[a-z]+)*\.[a-z]+\z/i
  
  validates   :email, presence: true, length: { maximum: 255 },
              format: { with: VALID_EMAIL_REGEX },
              uniqueness: { case_sensitive: false }
  
  has_secure_password
  validates :password, length: { minimum: 6 }
  </code></pre>
  
  <p>end</p>
  
  <p>Gemfile:</p>
  
  <pre><code> source 'https://rubygems.org'
  ruby '2.3.0'
  
  gem 'rails',                   '5.0.0.1'
  gem 'bcrypt',                  '3.1.11'
  gem 'faker',                   '1.6.3'
  gem 'carrierwave',             '0.11.2'
  gem 'mini_magick',             '4.5.1'
  gem 'fog',                     '1.38.0'
  gem 'will_paginate',           '3.1.0'
  gem 'bootstrap-will_paginate', '0.0.10'
  gem 'bootstrap-sass',          '3.3.6'
  gem 'puma',                    '3.4.0'
  gem 'sass-rails',              '5.0.6'
  gem 'uglifier',                '3.0.0'
  gem 'coffee-rails',            '4.2.1'
  gem 'jquery-rails',            '4.1.1'
  gem 'turbolinks',              '5.0.1'
  gem 'jbuilder',                '2.4.1'
  
  group :development, :test do
    gem 'sqlite3', '1.3.11'
    gem 'byebug',  '9.0.0', platform: :mri
  end
  
  group :development do
    gem 'web-console',           '3.1.1'
    gem 'listen',                '3.0.8'
    gem 'spring',                '1.7.2'
    gem 'spring-watcher-listen', '2.0.0'
  end
  
  group :test do
    gem 'rails-controller-testing', '0.1.1'
    gem 'minitest-reporters',       '1.1.9'
    gem 'guard',                    '2.13.0'
    gem 'guard-minitest',           '2.4.4'
  end
  
  group :production do
    gem 'pg',   '0.18.4'
  end
  
  # Windows does not include zoneinfo files, so bundle the tzinfo-data gem
  gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
  </code></pre>
  
  <p>Gemfile.lock:</p>
  
  <pre><code>    GEM
    remote: https://rubygems.org/
    specs:
      CFPropertyList (2.3.2)
      actioncable (5.0.0.1)
        actionpack (= 5.0.0.1)
        nio4r (~&gt; 1.2)
        websocket-driver (~&gt; 0.6.1)
      actionmailer (5.0.0.1)
        actionpack (= 5.0.0.1)
        actionview (= 5.0.0.1)
        activejob (= 5.0.0.1)
        mail (~&gt; 2.5, &gt;= 2.5.4)
        rails-dom-testing (~&gt; 2.0)
      actionpack (5.0.0.1)
        actionview (= 5.0.0.1)
        activesupport (= 5.0.0.1)
        rack (~&gt; 2.0)
        rack-test (~&gt; 0.6.3)
        rails-dom-testing (~&gt; 2.0)
        rails-html-sanitizer (~&gt; 1.0, &gt;= 1.0.2)
      actionview (5.0.0.1)
        activesupport (= 5.0.0.1)
        builder (~&gt; 3.1)
        erubis (~&gt; 2.7.0)
        rails-dom-testing (~&gt; 2.0)
        rails-html-sanitizer (~&gt; 1.0, &gt;= 1.0.2)
      activejob (5.0.0.1)
        activesupport (= 5.0.0.1)
        globalid (&gt;= 0.3.6)
      activemodel (5.0.0.1)
        activesupport (= 5.0.0.1)
      activerecord (5.0.0.1)
        activemodel (= 5.0.0.1)
        activesupport (= 5.0.0.1)
        arel (~&gt; 7.0)
      activesupport (5.0.0.1)
        concurrent-ruby (~&gt; 1.0, &gt;= 1.0.2)
        i18n (~&gt; 0.7)
        minitest (~&gt; 5.1)
        tzinfo (~&gt; 1.1)
      ansi (1.5.0)
      arel (7.1.1)
      autoprefixer-rails (6.4.1)
        execjs
      bcrypt (3.1.11)
      bootstrap-sass (3.3.6)
        autoprefixer-rails (&gt;= 5.2.1)
        sass (&gt;= 3.3.4)
      bootstrap-will_paginate (0.0.10)
        will_paginate
      builder (3.2.2)
      byebug (9.0.0)
      carrierwave (0.11.2)
        activemodel (&gt;= 3.2.0)
        activesupport (&gt;= 3.2.0)
        json (&gt;= 1.7)
        mime-types (&gt;= 1.16)
        mimemagic (&gt;= 0.3.0)
      coderay (1.1.1)
      coffee-rails (4.2.1)
        coffee-script (&gt;= 2.2.0)
        railties (&gt;= 4.0.0, &lt; 5.2.x)
      coffee-script (2.4.1)
        coffee-script-source
        execjs
      coffee-script-source (1.10.0)
      concurrent-ruby (1.0.2)
      debug_inspector (0.0.2)
      erubis (2.7.0)
      excon (0.52.0)
      execjs (2.7.0)
      faker (1.6.3)
        i18n (~&gt; 0.5)
      ffi (1.9.14)
      fission (0.5.0)
        CFPropertyList (~&gt; 2.2)
      fog (1.38.0)
        fog-aliyun (&gt;= 0.1.0)
        fog-atmos
        fog-aws (&gt;= 0.6.0)
        fog-brightbox (~&gt; 0.4)
        fog-cloudatcost (~&gt; 0.1.0)
        fog-core (~&gt; 1.32)
        fog-dynect (~&gt; 0.0.2)
        fog-ecloud (~&gt; 0.1)
        fog-google (&lt;= 0.1.0)
        fog-json
        fog-local
        fog-openstack
        fog-powerdns (&gt;= 0.1.1)
        fog-profitbricks
        fog-rackspace
        fog-radosgw (&gt;= 0.0.2)
        fog-riakcs
        fog-sakuracloud (&gt;= 0.0.4)
        fog-serverlove
        fog-softlayer
        fog-storm_on_demand
        fog-terremark
        fog-vmfusion
        fog-voxel
        fog-vsphere (&gt;= 0.4.0)
        fog-xenserver
        fog-xml (~&gt; 0.1.1)
        ipaddress (~&gt; 0.5)
      fog-aliyun (0.1.0)
        fog-core (~&gt; 1.27)
        fog-json (~&gt; 1.0)
        ipaddress (~&gt; 0.8)
        xml-simple (~&gt; 1.1)
      fog-atmos (0.1.0)
        fog-core
        fog-xml
      fog-aws (0.11.0)
        fog-core (~&gt; 1.38)
        fog-json (~&gt; 1.0)
        fog-xml (~&gt; 0.1)
        ipaddress (~&gt; 0.8)
      fog-brightbox (0.11.0)
        fog-core (~&gt; 1.22)
        fog-json
        inflecto (~&gt; 0.0.2)
      fog-cloudatcost (0.1.2)
        fog-core (~&gt; 1.36)
        fog-json (~&gt; 1.0)
        fog-xml (~&gt; 0.1)
        ipaddress (~&gt; 0.8)
      fog-core (1.42.0)
        builder
        excon (~&gt; 0.49)
        formatador (~&gt; 0.2)
      fog-dynect (0.0.3)
        fog-core
        fog-json
        fog-xml
      fog-ecloud (0.3.0)
        fog-core
        fog-xml
      fog-google (0.1.0)
        fog-core
        fog-json
        fog-xml
      fog-json (1.0.2)
        fog-core (~&gt; 1.0)
        multi_json (~&gt; 1.10)
      fog-local (0.3.0)
        fog-core (~&gt; 1.27)
      fog-openstack (0.1.12)
        fog-core (&gt;= 1.40)
        fog-json (&gt;= 1.0)
        ipaddress (&gt;= 0.8)
      fog-powerdns (0.1.1)
        fog-core (~&gt; 1.27)
        fog-json (~&gt; 1.0)
        fog-xml (~&gt; 0.1)
      fog-profitbricks (0.0.5)
        fog-core
        fog-xml
        nokogiri
      fog-rackspace (0.1.1)
        fog-core (&gt;= 1.35)
        fog-json (&gt;= 1.0)
        fog-xml (&gt;= 0.1)
        ipaddress (&gt;= 0.8)
      fog-radosgw (0.0.5)
        fog-core (&gt;= 1.21.0)
        fog-json
        fog-xml (&gt;= 0.0.1)
      fog-riakcs (0.1.0)
        fog-core
        fog-json
        fog-xml
      fog-sakuracloud (1.7.5)
        fog-core
        fog-json
      fog-serverlove (0.1.2)
        fog-core
        fog-json
      fog-softlayer (1.1.4)
        fog-core
        fog-json
      fog-storm_on_demand (0.1.1)
        fog-core
        fog-json
      fog-terremark (0.1.0)
        fog-core
        fog-xml
      fog-vmfusion (0.1.0)
        fission
        fog-core
      fog-voxel (0.1.0)
        fog-core
        fog-xml
      fog-vsphere (1.0.1)
        fog-core
        rbvmomi (~&gt; 1.8.0)
      fog-xenserver (0.2.3)
        fog-core
        fog-xml
      fog-xml (0.1.2)
        fog-core
        nokogiri (~&gt; 1.5, &gt;= 1.5.11)
      formatador (0.2.5)
      globalid (0.3.7)
        activesupport (&gt;= 4.1.0)
      guard (2.13.0)
        formatador (&gt;= 0.2.4)
        listen (&gt;= 2.7, &lt;= 4.0)
        lumberjack (~&gt; 1.0)
        nenv (~&gt; 0.1)
        notiffany (~&gt; 0.0)
        pry (&gt;= 0.9.12)
        shellany (~&gt; 0.0)
        thor (&gt;= 0.18.1)
      guard-compat (1.2.1)
      guard-minitest (2.4.4)
        guard-compat (~&gt; 1.2)
        minitest (&gt;= 3.0)
      i18n (0.7.0)
      inflecto (0.0.2)
      ipaddress (0.8.3)
      jbuilder (2.4.1)
        activesupport (&gt;= 3.0.0, &lt; 5.1)
        multi_json (~&gt; 1.2)
      jquery-rails (4.1.1)
        rails-dom-testing (&gt;= 1, &lt; 3)
        railties (&gt;= 4.2.0)
        thor (&gt;= 0.14, &lt; 2.0)
      json (2.0.2)
      listen (3.0.8)
        rb-fsevent (~&gt; 0.9, &gt;= 0.9.4)
        rb-inotify (~&gt; 0.9, &gt;= 0.9.7)
      loofah (2.0.3)
        nokogiri (&gt;= 1.5.9)
      lumberjack (1.0.10)
      mail (2.6.4)
        mime-types (&gt;= 1.16, &lt; 4)
      method_source (0.8.2)
      mime-types (3.1)
        mime-types-data (~&gt; 3.2015)
      mime-types-data (3.2016.0521)
      mimemagic (0.3.2)
      mini_magick (4.5.1)
      mini_portile2 (2.1.0)
      minitest (5.9.0)
      minitest-reporters (1.1.9)
        ansi
        builder
        minitest (&gt;= 5.0)
        ruby-progressbar
      multi_json (1.12.1)
      nenv (0.3.0)
      nio4r (1.2.1)
      nokogiri (1.6.8)
        mini_portile2 (~&gt; 2.1.0)
        pkg-config (~&gt; 1.1.7)
      notiffany (0.1.1)
        nenv (~&gt; 0.1)
        shellany (~&gt; 0.0)
      pg (0.18.4)
      pkg-config (1.1.7)
      pry (0.10.4)
        coderay (~&gt; 1.1.0)
        method_source (~&gt; 0.8.1)
        slop (~&gt; 3.4)
      puma (3.4.0)
      rack (2.0.1)
      rack-test (0.6.3)
        rack (&gt;= 1.0)
      rails (5.0.0.1)
        actioncable (= 5.0.0.1)
        actionmailer (= 5.0.0.1)
        actionpack (= 5.0.0.1)
        actionview (= 5.0.0.1)
        activejob (= 5.0.0.1)
        activemodel (= 5.0.0.1)
        activerecord (= 5.0.0.1)
        activesupport (= 5.0.0.1)
        bundler (&gt;= 1.3.0, &lt; 2.0)
        railties (= 5.0.0.1)
        sprockets-rails (&gt;= 2.0.0)
      rails-controller-testing (0.1.1)
        actionpack (~&gt; 5.x)
        actionview (~&gt; 5.x)
        activesupport (~&gt; 5.x)
      rails-dom-testing (2.0.1)
        activesupport (&gt;= 4.2.0, &lt; 6.0)
        nokogiri (~&gt; 1.6.0)
      rails-html-sanitizer (1.0.3)
        loofah (~&gt; 2.0)
      railties (5.0.0.1)
        actionpack (= 5.0.0.1)
        activesupport (= 5.0.0.1)
        method_source
        rake (&gt;= 0.8.7)
        thor (&gt;= 0.18.1, &lt; 2.0)
      rake (11.2.2)
      rb-fsevent (0.9.7)
      rb-inotify (0.9.7)
        ffi (&gt;= 0.5.0)
      rbvmomi (1.8.2)
        builder
        nokogiri (&gt;= 1.4.1)
        trollop
      ruby-progressbar (1.8.1)
      sass (3.4.22)
      sass-rails (5.0.6)
        railties (&gt;= 4.0.0, &lt; 6)
        sass (~&gt; 3.1)
        sprockets (&gt;= 2.8, &lt; 4.0)
        sprockets-rails (&gt;= 2.0, &lt; 4.0)
        tilt (&gt;= 1.1, &lt; 3)
      shellany (0.0.1)
      slop (3.6.0)
      spring (1.7.2)
      spring-watcher-listen (2.0.0)
        listen (&gt;= 2.7, &lt; 4.0)
        spring (~&gt; 1.2)
      sprockets (3.7.0)
        concurrent-ruby (~&gt; 1.0)
        rack (&gt; 1, &lt; 3)
      sprockets-rails (3.2.0)
        actionpack (&gt;= 4.0)
        activesupport (&gt;= 4.0)
        sprockets (&gt;= 3.0.0)
      sqlite3 (1.3.11)
      thor (0.19.1)
      thread_safe (0.3.5)
      tilt (2.0.5)
      trollop (2.1.2)
      turbolinks (5.0.1)
        turbolinks-source (~&gt; 5)
      turbolinks-source (5.0.0)
      tzinfo (1.2.2)
        thread_safe (~&gt; 0.1)
      uglifier (3.0.0)
        execjs (&gt;= 0.3.0, &lt; 3)
      web-console (3.1.1)
        activemodel (&gt;= 4.2)
        debug_inspector
        railties (&gt;= 4.2)
      websocket-driver (0.6.4)
        websocket-extensions (&gt;= 0.1.0)
      websocket-extensions (0.1.2)
      will_paginate (3.1.0)
      xml-simple (1.1.5)
  
  PLATFORMS
    ruby
  
  DEPENDENCIES
    bcrypt (= 3.1.11)
    bootstrap-sass (= 3.3.6)
    bootstrap-will_paginate (= 0.0.10)
    byebug (= 9.0.0)
    carrierwave (= 0.11.2)
    coffee-rails (= 4.2.1)
    faker (= 1.6.3)
    fog (= 1.38.0)
    guard (= 2.13.0)
    guard-minitest (= 2.4.4)
    jbuilder (= 2.4.1)
    jquery-rails (= 4.1.1)
    listen (= 3.0.8)
    mini_magick (= 4.5.1)
    minitest-reporters (= 1.1.9)
    pg (= 0.18.4)
    puma (= 3.4.0)
    rails (= 5.0.0.1)
    rails-controller-testing (= 0.1.1)
    sass-rails (= 5.0.6)
    spring (= 1.7.2)
    spring-watcher-listen (= 2.0.0)
    sqlite3 (= 1.3.11)
    turbolinks (= 5.0.1)
    tzinfo-data
    uglifier (= 3.0.0)
    web-console (= 3.1.1)
    will_paginate (= 3.1.0)
  
  RUBY VERSION
     ruby 2.3.0p0
  
  BUNDLED WITH
     1.12.5
  </code></pre>
  
  <p>Backtrace from running <code>heroku run console</code>:</p>
  
  <pre><code>    ... up, run.9075 (Free)
  /app/app/models/user.rb:1:in `&lt;top (required)&gt;': uninitialized constant ApplicationRecord (NameError)
      from /app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.0.0.1/lib/active_support/dependencies/interlock.rb:12:in `block in loading'
      from /app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.0.0.1/lib/active_support/concurrency/share_lock.rb:117:in `exclusive'
      from /app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.0.0.1/lib/active_support/dependencies/interlock.rb:11:in `loading'
      from /app/vendor/bundle/ruby/2.3.0/gems/railties-5.0.0.1/lib/rails/engine.rb:476:in `block (2 levels) in eager_load!'
      from /app/vendor/bundle/ruby/2.3.0/gems/railties-5.0.0.1/lib/rails/engine.rb:475:in `each'
      from /app/vendor/bundle/ruby/2.3.0/gems/railties-5.0.0.1/lib/rails/engine.rb:475:in `block in eager_load!'
      from /app/vendor/bundle/ruby/2.3.0/gems/railties-5.0.0.1/lib/rails/engine.rb:473:in `each'
      from /app/vendor/bundle/ruby/2.3.0/gems/railties-5.0.0.1/lib/rails/engine.rb:473:in `eager_load!'
      from /app/vendor/bundle/ruby/2.3.0/gems/railties-5.0.0.1/lib/rails/engine.rb:354:in `eager_load!'
      from /app/vendor/bundle/ruby/2.3.0/gems/railties-5.0.0.1/lib/rails/application/finisher.rb:59:in `each'
      from /app/vendor/bundle/ruby/2.3.0/gems/railties-5.0.0.1/lib/rails/application/finisher.rb:59:in `block in &lt;module:Finisher&gt;'
      from /app/vendor/bundle/ruby/2.3.0/gems/railties-5.0.0.1/lib/rails/initializable.rb:30:in `instance_exec'
      from /app/vendor/bundle/ruby/2.3.0/gems/railties-5.0.0.1/lib/rails/initializable.rb:30:in `run'
      from /app/vendor/bundle/ruby/2.3.0/gems/railties-5.0.0.1/lib/rails/initializable.rb:55:in `block in run_initializers'
      from /app/vendor/ruby-2.3.0/lib/ruby/2.3.0/tsort.rb:228:in `block in tsort_each'
      from /app/vendor/ruby-2.3.0/lib/ruby/2.3.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
      from /app/vendor/ruby-2.3.0/lib/ruby/2.3.0/tsort.rb:431:in `each_strongly_connected_component_from'
      from /app/vendor/ruby-2.3.0/lib/ruby/2.3.0/tsort.rb:349:in `block in each_strongly_connected_component'
      from /app/vendor/ruby-2.3.0/lib/ruby/2.3.0/tsort.rb:347:in `each'
      from /app/vendor/ruby-2.3.0/lib/ruby/2.3.0/tsort.rb:347:in `call'
      from /app/vendor/ruby-2.3.0/lib/ruby/2.3.0/tsort.rb:347:in `each_strongly_connected_component'
      from /app/vendor/ruby-2.3.0/lib/ruby/2.3.0/tsort.rb:226:in `tsort_each'
      from /app/vendor/ruby-2.3.0/lib/ruby/2.3.0/tsort.rb:205:in `tsort_each'
      from /app/vendor/bundle/ruby/2.3.0/gems/railties-5.0.0.1/lib/rails/initializable.rb:54:in `run_initializers'
      from /app/vendor/bundle/ruby/2.3.0/gems/railties-5.0.0.1/lib/rails/application.rb:352:in `initialize!'
      from /app/config/environment.rb:5:in `&lt;top (required)&gt;'
      from /app/vendor/bundle/ruby/2.3.0/gems/railties-5.0.0.1/lib/rails/application.rb:328:in `require'
      from /app/vendor/bundle/ruby/2.3.0/gems/railties-5.0.0.1/lib/rails/application.rb:328:in `require_environment!'
      from /app/vendor/bundle/ruby/2.3.0/gems/railties-5.0.0.1/lib/rails/commands/commands_tasks.rb:157:in `require_application_and_environment!'
      from /app/vendor/bundle/ruby/2.3.0/gems/railties-5.0.0.1/lib/rails/commands/commands_tasks.rb:77:in `console'
      from /app/vendor/bundle/ruby/2.3.0/gems/railties-5.0.0.1/lib/rails/commands/commands_tasks.rb:49:in `run_command!'
      from /app/vendor/bundle/ruby/2.3.0/gems/railties-5.0.0.1/lib/rails/commands.rb:18:in `&lt;top (required)&gt;'
      from bin/rails:9:in `require'
      from bin/rails:9:in `&lt;main&gt;'
  </code></pre>
  
  <p>boot.rb:</p>
  
  <pre><code>    ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
  
  require 'bundler/setup' # Set up gems listed in the Gemfile.
  </code></pre>
  
  <p>console histroy, for what it's worth:</p>
  
  <pre><code>      387  cd RailsTutorial/
    388  cd sample_app/
    389  subl .
    390  git st
    391  rails g migration add_password_digest_to_users password_digest:string
    392  bundle exec rake db:migrate
    393  rails console
    394  git st
    395  git add ,
    396  git add .
    397  git commit -am 'Make basic user model (inc secure passwords)"
    398  '
    399  git br
    400  git co master
    401  git push origin master
    402  git push heroku
    403  heroku run rake db:migrate
    404  heroku run console
    405  heroku run console --sandbox
    406  heroku run rake db:migrate
    407  heroku run console --sandbox
    408  git st
    409  git commit -am "Updating has_secure_password in User model"
    410  '
    411  git commit -am "Updating has_secure_password in User model"
    412  '
    413  git commit -am "Updating has_secure_password in User model"
    414  git add .
    415  git commit -am "Updating has_secure_password in User model"
    416  git push origin master
    417  git push heroku master
    418  heroku run rake db:migrate
    419  heroku console --sandbox
    420  heroku console --sandbox
    421  heroku run console --sandbox
    422  git push heroku master
    423  git st
    424  heroku run console --sandbox
    425  heroku run console
    426  git st
    427  git br
    428  git commit -am 'bugging &lt; ApplicationRecord error'
    429  git push origin master
    430  git push heroku master
    431  heroku run rake db:migrate
    432  herokue run console --sandbox
    433  heroku run console --sandbox
    434  rails s
    435  git diff
    436  git st
    437  git br
    438  git co modelling-users
    439  git st
    440  git co master
    441  bundle exec guard
    442  ruby /test/integration/site_layout_test.rb --name layout links
    443  ruby /test/integration/site_layout_test.rb
    444  ruby test/integration/site_layout_test.rb
    445  rake test
    446  rake test/integration/site_layout_test.rb
    447  rake test/integration/site_layout_test.rb
    448  ruby /test/integration/site_layout_test.rb --name layout links
    449  ruby test/integration/site_layout_test.rb --name layout links
    450  rake test TEST=test/integration/site_layout_test.rb
    451  rake test TEST=test/integration/site_layout_test.rb name- layout links
    452  ruby test/integration/site_layout_test.rb name- layout links
    453  ruby test/integration/site_layout_test.rb --name layout links
    454  rake test TEST=test/integration/site_layout_test.rb --name layout links
    455  rake test TEST=test/integration/site_layout_test.rb --name layout links
    456  ruby -Itest test/integration/site_layout_test.rb --name layout links
    457  ruby -Itest test/integration/site_layout_test.rb --name layout_links
    458  ruby -Itest test/integration/site_layout_test.rb --name layout_links
    459  rake test TEST=test/integration/site_layout_test.rb
    460  bundle exec guard
    461  bundle exec guard
    462  bundle exec guard
    463  git st
    464  git add .
    465  git st
    466  git st
    467  git commit -am 'adding, migrating and testing user model with name and email attrs'
    468  git st
    469  git push origina master
    470  git push heroku
    471  git push heroku
    472  bundle exec guard
    473  bundle exec guard
    474  bundle exec guard
    475  rails s
    476  rails s
    477  rails s
    478  pswl
    479  psql
    480  pwd
    481  cd Code/
    482  ls
    483  cd RailsTutorial/sample_app/
    484  rails test
    485  rails test:models
    486  bundle exec rake db:migrate
    487  rails test:models
    488  ls
    489  git st
    490  git diff
    491  rails test:models
    492  git st
    493  git add .
    494  git commit -am 'debugging ApplicationRecord'
    495  git br
    496  rails test
    497  git push heroku master
    498  heroku run rake db:migrate
    499  heroku run console
    500  pwd
    501  cd Code/RailsTutorial/sample_app/
    502  rails test
    503  subl .
    504  psql
    505  rails test
    506  rails test
    507  git history
    508  git hist
    509  history
  </code></pre>
  
  <p>Just gone through whole directory file by file and have seen that my migrations directory and contents has completely dissapeared. V strange. The schema.rb is completely up to date. Command history above shows what's been done since I last saw the migrations directory and its correct migration file contents. Previous git commit was unfortunately before this whole model was generated thus have no previous commit with these migration contents</p>
  
  <p>Any ideas of how to get me out of my amateur muddle? Thanks</p>