It keeps telling me to capitalize first last and city


<Below this line, add a link to the EXACT exercise that you are stuck at.>
ruby section 1.6 entitled putting the form in formatter
what would be helpful is a screenshot with an explanation of wy mine is an error

<In what way does your code behave incorrectly? Include ALL error messages.>
undefined local variable or method `name’ for #Context:0x10031dc is my error message
how have I not capitlized first name last name and city

print "What's your first name?"
first_name = gets.chomp

print "whats your last name?"
last_name =gets.chomp

print "what city are you from?"
city = gets.chomp

print "which state are you from?"
state= gets.chomp

first_name= "prince"
puts "#{first name}"
puts "your name is #{first_name}!"

last_name "harry"
puts "#{last_name}"
puts " your last name is #{last_name}!"

city "bedford"
puts "#{city}"
puts "you are from #{city}!"

state "bedfordshire"
puts "#{state}!"
puts "you are from #{state}!" 

Do you mean for a variable with the name name to be defined?
If yes, then where are you doing that?
If no, then why and where are you using something that you don’t mean to be defined?

i do not quite understand what you are asking however the bit of text you are asking about is what i copied and pasted from the black box in the top left

That’s ruby telling you what went wrong. It says you’re using a name that has not been defined, so either you failed to define it or shouldn’t be referring to that name at all. So you’ll have to ask yourself what you meant to happen there.

by defining it what do you mean? capitalizing or making it uppercase ?

You’re doing something like this:

# Beginning of file, nothing above this
puts aoeutnha  # error, aoeutnha hasn't been defined

So either I should have given that variable a value, or I shouldn’t be using it.

so basically theres nothing for ruby to capitalize

Ruby doesn’t try to capitalize anything, because you’re using a variable that doesn’t exist. And even if it existed, you aren’t saying that it should be capitalized.

Go look for the undefined variable that you are using, the error message that ruby is giving you is telling you which one it is.

this is what my code looks like.
rint “What is your first name?”
first_name = gets.chomp
first_name= first_name.capitalize
print “What is your last name?”
last_name= gets.chomp
last_name= last_name.capitalize
print “What city are you from?”
city= gets.chomp
city= city.capitalize
print “What State or Province are you from?”
state= gets.chomp
state= state.upcase
puts “Your name is #{first_name} #{last_name} from #{city}, #{state}”

Im new to coding and not at all a pro I’m just doing what the lesson told me to do. it looks like you’re missing a line and an exclaimation point!

i got it working with this:

print “what’s your first name?”
first_name= gets.chomp
first_name2= first_name.capitalize!
puts “Your name is #{first_name2}!”

print “What’s your last name?”
last_name= gets.chomp
last_name2= last_name.capitalize!
puts “You’re last name is #{last_name2}!”

print “What’s your city?”
city= gets.chomp
city2= city.capitalize!
puts “You’re city is #{city2}!”

print “What’s your state?”
state= gets.chomp
state2= state.upcase!
puts “You’re state is #{state2}!”

Around the first_name variable you put
puts “#{first name}”
which is incorrect because your variable is first_name meaning just add an underscore.
Hope this helps!