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

Can't Create the Final Popup #152

Open ZMan84 opened 13 years ago

ZMan84 commented 13 years ago

Whenever I try to enter any of the code that is given when trying to create the final popup that displays the blog you've created, I get this error code: NoMethodError: undefined method `h2' for main:Object

Even when I use the little piece of code that is given: blog.each do |entry| h2 entry.title p entry.fulltext end ...I still get the same error.

So what method am I having issues with or, if that's not the issue, what am I doing wrong b/c I just spent all this time getting excited about Ruby and I want to see my darned final product.

Thanks all, Zach

davidmiani commented 13 years ago

That is only part of the code. The h2 and p methods are only available inside a Popup.make block. For example this will work:

Popup.make do
  h2 "Some header"
end

While the following with cause a NoMethodError:

h2 "Some header not in a Popup.make block
re4ctionary commented 13 years ago

I don't want to spoil the learning process for you or anyone else that may have the same concern- so I won't just give you the answer. However, I will say this: the designers of this tutorial, basically, gave you "copy & paste"-able code throughout the entire course. At this point in the tutorial, you need to leverage the past exercises that you completed in order to complete the learning process.

Come on ZMan, you've gotten this far (and learned tons along the way!) don't give up the satisfaction of completion simply because it wasn't just handed to you.

Note: Read the section (the entire thing, not just the highlighted code).

Best of luck! R

beingsagir commented 11 years ago

that was an important part of that course

U need to follow the previous lesson u ve already learn into that course.

u just need to create a popup

inside that u need to use h1 for a nice name of your blog page,

and then use that prepared code along with a line which displays the time.

Happy Learning Bros :)

Heril commented 11 years ago

One thing to note, I was just skimming through the instructions at this point, so I missed that I had to come up with some of the code on my own. After making the mistake of just typing in the prewritten code, I would always get the NoMethod error for h2(which happened when making said error and every time I would try to call Popup.make. Restarting the tutorial fixed it.

ghost commented 11 years ago

oh plz just write the answer i''m stuck!!

anjerodesu commented 10 years ago

It's like you guys didn't actually learnt anything. The tutorial is easy enough to understand..

MarinoPoletine commented 10 years ago

TBH I can't either. But I am not getting errors. My problem is that popups are not working correctly with me. Even in the popup tutorial, it never worked. I am using Safari. At this point I don't know if I am an idiot or the popup is broken.

truncj commented 10 years ago

Restarting the tutorial fixed it! Thanks Heril

baraka2000 commented 8 years ago

I can't get the Popup to work at all. Using chrome, Popup.goto "http://bing.com" doesn't even work??