Jump to content

Need help with ruby error

Meawa
Go to solution Solved by Assassin,

 

Im struggling to learn ruby and im stuck at this one part where i keep getting this error message. http://prntscr.com/7j2vju

 

Is anything wrong with my code?

 

this is the ruby im running: http://prntscr.com/7j2w0gand im running on windows

 

Here is my code:

 

 
-------
puts ("i'd like to ask you a few questions")

That should do it. You need to put them in quotes. Also what IDE are you using? If not consider using one. It will help you avoid easy syntax errors like this.

Im struggling to learn ruby and im stuck at this one part where i keep getting this error message. http://prntscr.com/7j2vju

 

Is anything wrong with my code?

 

this is the ruby im running: http://prntscr.com/7j2w0gand im running on windows

 

Here is my code:

 

puts hi, #{user}, i'm the #{$0} script.
puts i'd like to ask you a few questions.
puts do you like me #{user}
print prompt
likes = STDIN.gets.chomp()
 
puts where do you live #{user}
print prompt
lives = STDIN.gets.chomp()
 
puts What kind of computer do you have
print prompt
computer = STDIN.gets.chomp()
 
puts MESSAGE
alright so you said #{likes} about liking me.
you live in #{lives}. Not sure where that is.
and you have a #{computer} computer. nice.
MESSAGE

 

 

i7-5820K | ASUS X99-A | Corsair DDR4 LPX 16 GB | MSI GTX 970 Gaming | Corsair 750D | WD Black 1 TB | MX100 256 GB | EVGA SuperNOVA 750 Watt | ASUS VG248QE | Corsair H105 | K70 MX blues non-RGB | M95 | H1500 | Windows 8.1 64-bit

Link to comment
Share on other sites

Link to post
Share on other sites

 

Im struggling to learn ruby and im stuck at this one part where i keep getting this error message. http://prntscr.com/7j2vju

 

Is anything wrong with my code?

 

this is the ruby im running: http://prntscr.com/7j2w0gand im running on windows

 

Here is my code:

 

 
-------
puts ("i'd like to ask you a few questions")

That should do it. You need to put them in quotes. Also what IDE are you using? If not consider using one. It will help you avoid easy syntax errors like this.

The only way to deal with an unfree world is to become so absolutely free that your very existence is an act of rebellion.

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×