Sophrinix / TryRuby

Try Ruby is a interactive shell that quickly and whimsically teaches the Ruby programming language. Originally _why's idea, it has been recreated from the ground up by Rubyists who have a passion for Ruby and for teaching their fellow (wo)man how to program.
tryruby.org
347 stars 79 forks source link

“It’s All About Combining Things”: blog << new_entry #123

Closed benpoole closed 13 years ago

benpoole commented 13 years ago

blog << new_entry needs more explanation. As a noob, I tried a few different ways of running this expression, and just got internal server errors every time. Here's one I tried, which I thought would work:

blog << BlogEntry.new("some title", :confused; "Some entry text")
joanwolk commented 13 years ago

Seconding the problem with new_entry. (OSX 10.6.6, RockMelt browser)

benpoole, I think your attempt with BlogEntry.new should work if you replace the semicolon after :confused with a comma.

benpoole commented 13 years ago

Thanks for the tip; the code I pasted in here had a typo is all—I typed in the code as one would expect in the irb pane, and it still fails (i.e. blog << BlogEntry.new("some title", :confused, "Some entry text") )

joanwolk commented 13 years ago

What error did you get?

benpoole commented 13 years ago

Problem solved. I have now face-palmed repeatedly. I was getting an Apache internal server error (500) - a load of HTML in the irb pane. However, this is because I am an idiot I was typing the « character instead of <<

My apologies!