Please use our GitHub Issues page for all new support inquiries. If you need to contact us directly, please e-mail [email protected]

What does unexpected '/n' error mean in Ruby programming and how can I correct this error encountered while running a script?

asked 09 Dec '14, 13:12

Tanya's gravatar image

accept rate: 0%

Ok, having seen your script I know why you're getting that error, and also see some other issues you'll need to fix.

The syntax error you asked about is coming from line 21. You have

for "MomSpeech cells in MomSpeech.cells"

This won't work because anything in quotes is treated as text. Plus you can't have a space between the variable name and "cell". You want it to be

for MomSpeechcell in MomSpeech.cells

You'll have to make similar changes to the other for loops you wrote.

But you also have similar issues later in the script, where you actually print the data. Basically, any time you're refering to the list of cells, it needs to be VariableName.cells. Anytime you're refering to an individual cell (like in the line where you're printing) you have to be consistent in the name (MomSpeechcell, in the example above). If you call it MomSpeechcell in the for loop, you have to call it that throughout the script. MomSpeechcells and MomSpeech cell will break the script; it won't know what those are, so it can't print the data the cell contains.

You're also trying to print some codes that aren't in the sample spreadsheet you send us (MomSpeech.MomSpeechnum, for example). I don't know if that's just this spreadsheet, but it won't print until all of those match the file as well.

If part of that didn't make sense, or you're still unsure what to do, let me know.

permanent link

answered 10 Dec '14, 13:21

WhitneyCole's gravatar image

WhitneyCole ♦
accept rate: 21%

Without more information I'm not sure what's happening. Can you give us the exact text of the error you're getting, and a copy of your script?

permanent link

answered 10 Dec '14, 11:16

WhitneyCole's gravatar image

WhitneyCole ♦
accept rate: 21%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:


question asked: 09 Dec '14, 13:12

question was seen: 3,812 times

last updated: 10 Dec '14, 13:21

Related questions

powered by OSQA