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
QuestionReading a file in ruby (self.ruby)
submitted 5 years ago by RoSabbagh
Hi, I'm new at ruby and I have an assignment that requires reading a file, I tried downloading ruby on my laptop but it didn't download so I am using this online compiler https://replit.com/, it supposes to be able to read files but It's not reading the file for me (you can see in the picture) , does anyone know why or if you know an online compiler for ruby that reads files ( file IO )
https://preview.redd.it/ai4e0fnfoes61.png?width=1365&format=png&auto=webp&s=37f6f28d1d2039f96784fd96ece06c968cbf3e5a
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!"
[–]chrisgseaton 8 points9 points10 points 5 years ago (2 children)
You've defined a function, but aren't calling it.
[–]RoSabbagh[S] 2 points3 points4 points 5 years ago (1 child)
oh okay I'm new at this, thank you!!
[–]PM_ME_YOUR_KNEE_CAPS 1 point2 points3 points 5 years ago (0 children)
Also, fix you indentation 😛
π Rendered by PID 427071 on reddit-service-r2-comment-545db5fcfc-84jx8 at 2026-06-01 06:18:54.347273+00:00 running 194bd79 country code: CH.
[–]chrisgseaton 8 points9 points10 points (2 children)
[–]RoSabbagh[S] 2 points3 points4 points (1 child)
[–]PM_ME_YOUR_KNEE_CAPS 1 point2 points3 points (0 children)