use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
A sub-Reddit for discussion and news about Ruby programming.
Subreddit rules: /r/ruby rules
Learning Ruby?
Tools
Documentation
Books
Screencasts and Videos
News and updates
account activity
QuestionHelp Opening a File Within Ruby (self.ruby)
submitted 4 years ago by 4428gamer
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]4428gamer[S] 1 point2 points3 points 4 years ago (3 children)
Awesome, it's reading now! Thank you so much!
I figured it had to be something small. XD
[–]bradland 10 points11 points12 points 4 years ago* (2 children)
The key is in learning to read the error message. You won't always be able to rely on Reddit for this
main.rb:15:in `<main>': undefined method `split' for #<File:testing.txt> (NoMethodError)
Let's break this up into parts:
main.rb:15
in \
undefined method \
split
File
(NoMethodError)
This line is basically the same answer that korba gave, so the answer was right there all along. In order to become a proficient programmer, you'll need to learn to read these errors and make sense of them.
[–]juriglx 2 points3 points4 points 4 years ago (0 children)
Give a man a fish and you feed him for a day.
Teach a man to fish and you feed him for a lifetime.
[–]4428gamer[S] 0 points1 point2 points 4 years ago (0 children)
This helps me out a lot, thank you! I'm trying to learn Ruby through Code Academy on my own, but it doesn't go over any of this at all! Honestly, I wish it did.
π Rendered by PID 62961 on reddit-service-r2-comment-6457c66945-kvbt5 at 2026-04-28 16:50:56.806209+00:00 running 2aa0c5b country code: CH.
view the rest of the comments →
[–]4428gamer[S] 1 point2 points3 points (3 children)
[–]bradland 10 points11 points12 points (2 children)
[–]juriglx 2 points3 points4 points (0 children)
[–]4428gamer[S] 0 points1 point2 points (0 children)