Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7022979
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T23:39:07+00:00 2026-05-27T23:39:07+00:00

I am working through this tutorial book and have run into an issue with

  • 0

I am working through this tutorial book and have run into an issue with the rails console not recognizing the user model that I’ve created. Here is what I am working with

This is what I’ve defined in my user model, user.rb, located in sample_app/app/models/user.rb:

class user < ActiveRecord::Base
  attr_accessible :name, :email
  validates :name, :presence => true
end

This is what I get in console when I try to reference it:

Nicholass-MacBook-Pro:sample_app nbkincaid$ rails console
Loading development environment (Rails 3.1.1)
ruby-1.9.2-p290 :001 > user.new
NameError: undefined local variable or method `user' for main:Object from (irb):1
    from /Users/nbkincaid/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/commands/console.rb:45:in `start'
    from /Users/nbkincaid/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/commands/console.rb:8:in `start'
    from /Users/nbkincaid/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/commands.rb:40:in `<top (required)>'
    from script/rails:6:in `require'
    from script/rails:6:in `<main>'

Is there a specific gem version set that I need to adhere to, or is there something else that I am missing? I can’t quite figure this one out.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T23:39:08+00:00Added an answer on May 27, 2026 at 11:39 pm

    You can’t lowercase a class name if I recall correctly.

    Try renaming the class to User

    The following should work:

    class User < ActiveRecord::Base
      attr_accessible :name, :email
      validates :name, :presence => true
    end
    

    rails c

    User.new

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am working through this tutorial book and have set up my heroku account
Working through a zend tutorial & get this message, & not sure where to
I am working through a C#/ASP.NET tutorial and I run into an operator i
I am working through the Ruby on Rails 3 tutorial book and typed the
I am working through this extJS tutorial where you type in code into Firebug,
I am working on a Drupal setup and have run into a slight issue
I'm working my way through this tutorial here about progress dialogues but have hit
I'm working through this MVC3 tutorial and have entered the genre of a film
I am currently working through this tutorial: Getting Started with jQuery For the two
I'm working through the NerdDinner MVC tutorial and came across this and was wondering

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.