0

I'm learning Ruby through the Learn Ruby The Hard Way method and I had trouble with running this program... can you help me?

When I try to run the program I did with tex editor, I get this error:

MacBook-Air-de-Andre:Aulas_Ruby andrelfdacosta$ Ruby ex1.rb /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/universal-darwin13/rbconfig.rb:212: warning: Insecure world writable dir /usr/local in PATH, mode 040777 ex1.rb:6: unterminated string meets end of file

I'm positively on the right folder (directory) but still... have no idea what is happening.

Thanks!

Andre
  • 11
  • 4
  • ruby -c ex1.rb (check syntax) ? Im pretty sure your missing some quotes. Double check the quotes, and start simple ;-) Quotes within quotes can be tricky (and that what the exercise is about). – Roger Nov 18 '13 at 10:16

1 Answers1

0

Would be much better if you posted your source code, as without it it is hard to tell what is wrong.

Though, in your case error tells exactly what should be checked/corrected. Probably you opened String with quotation mark and you forgot to close it. That is why error:

ex1.rb:6: unterminated string meets end of file 

might have shown up. Please attach your source code. (File ex1.rb)

while Warning in first part of your message concerns permissions to the dir mentioned in the line below.

MacBook-Air-de-Andre:Aulas_Ruby andrelfdacosta$ Ruby ex1.rb /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/universal-darwin13/rbconfig.rb:212: warning: Insecure world writable dir /usr/local in PATH, mode 040777

You need to change permissions to your folder. Please refer to answer which was already given in StackOVerflow portal.

Insecure world writable dir /Users/username in PATH, mode 040777 when running Ruby commands

Community
  • 1
  • 1
  • Thank you very much for your answer... see, I'm very newbie, don't even know what the source code would be... guess it is the program I wrote? That would be this: puts "Hello World!" puts "Hello Again" puts "This is fun." puts 'Yay! Printing.' puts "I'd much rather you 'not'." puts 'I "said" do not touch this. Thanks @Mateusz Fryc – Andre Nov 18 '13 at 10:12
  • Thanks for the info @Mateuz. Corrected the quotes, it worked. Now I'll go check the link you gave me. Thx – Andre Nov 18 '13 at 10:23
  • If my answer helped you then please mark this as an answer. If your typed exactly source code in you comment as it is in your source code, then you miss ' at the end of last puts. However searching for syntax mistakes if any occurs is also a part of education, so I would rather insist on doing it by yourself rather than posting new questions here, especially that your case is trivial and probably was discussed many times already. – Mateusz Fryc Nov 18 '13 at 10:25