title: Ruby on Rails - NameError: uninitialized constant User
body: <p>Haven't used Rails in a while and just cloned a project, trying to work with the database but I'm getting this uninitialized constant error and I can't seem to figure out why. I bundle installed, created the database, migrated and seeded some files but I can't seem to find the root of the issue. It's not a small project and it seemed to be working fine back when I used it... Any help would be appreciated it... </p>
  
  <p>Here's my gemfile:</p>
  
  <pre><code>source 'https://rubygems.org'
  
  git_source(:github) do |repo_name|
    repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/")
    "https://github.com/#{repo_name}.git"
  end
  
  # Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
  gem 'rails', '~&gt; 5.1.1'
  gem 'httparty'
  # Use postgresql as the database for Active Record
  gem 'pg', '~&gt; 0.18'
  # Use Puma as the app server
  gem 'puma', '~&gt; 3.7'
  # Use SCSS for stylesheets
  gem 'sass-rails', '~&gt; 5.0'
  # Use Uglifier as compressor for JavaScript assets
  gem 'uglifier', '&gt;= 1.3.0'
  # See https://github.com/rails/execjs#readme for more supported runtimes
  # gem 'therubyracer', platforms: :ruby
  # Use CoffeeScript for .coffee assets and views
  gem 'coffee-rails', '~&gt; 4.2'
  # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
  gem 'jbuilder', '~&gt; 2.5'
  # Use Redis adapter to run Action Cable in production
  # gem 'redis', '~&gt; 3.0'
  # Use ActiveModel has_secure_password
  gem 'bcrypt', '~&gt; 3.1.7'
  # gem 'bcrypt', git: 'https://github.com/codahale/bcrypt-ruby.git', :require =&gt; 'bcrypt'
  gem 'semantic-ui-sass', git: 'https://github.com/doabit/semantic-ui-sass.git'
  # gem 'capistrano-rails', group: :development
  gem 'pg_search'
  
  group :development, :test do
    # Call 'byebug' anywhere in the code to stop execution and get a debugger console
    gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
    gem 'faker'
  end
  
  group :development do
    # Access an IRB console on exception pages or by using &lt;%= console %&gt; anywhere in the code.
    gem 'web-console', '&gt;= 3.3.0'
    gem 'listen', '&gt;= 3.0.5', '&lt; 3.2'
    # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
    gem 'spring'
    gem 'spring-watcher-listen', '~&gt; 2.0.0'
  end
  gem 'rails_12factor', group: :production
  # Windows does not include zoneinfo files, so bundle the tzinfo-data gem
  gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
  </code></pre>
  
  <p>And here's the User model:</p>
  
  <pre><code>class User &lt; ApplicationRecord
    validates :first_name, :last_name, :presence =&gt; true
    validates :username, :email, :presence =&gt; true, :uniqueness =&gt; true
    has_many :messages
    has_many :posts, :foreign_key =&gt; :creator_id
    has_many :apprenticeships, :foreign_key =&gt; :requestor_id
    has_many :skills, through: :posts
  
    has_secure_password
  
    def full_name
      "#{self.first_name} #{self.last_name}"
    end
  
  end
  </code></pre>
  
  <p>I have also tried checking if tables were created with <code>ActiveRecord::Base.connection.tables</code> but I'm still getting <code>NameError: uninitialized constant ActiveRecord</code></p>