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

Unable to pass the comics = load_comics step #69

Closed sethladd closed 14 years ago

sethladd commented 14 years ago

Running into trouble getting past the step of comics = load_comics('/comics.txt')

=> nil

File.open("/Home/comics.txt", "a") do |f|
.. f << "cat and Girl: http://catandgirl.com/\n"
.. end
=> #<File:/Home/comics.txt (closed)>
File.mtime("/Home/comics.txt")
=> 2010-08-30 05:08:58 +0000
File.mtime("/Home/comics.txt").hour
=> 5
def load_comics(path)
.. comics = {}
.. File.foreach(path) do |line|
.. name, url = line.split(': ')
.. comics[name] = url.strip
.. end
.. comics
.. end
=> nil
comics = load_comics('/comics.txt')
NameError: undefined local variable or method a' for main:Object def load_comics(path) .. comics = {} .. File.foreach(path) do |line| .. name, url = line.split(': ') NameError: undefined local variable or methodline' for main:Object
back
def load_comics(path)
.. comics = {}
.. File.foreach(path) do |line|
.. name, url = line.split(':
SyntaxError: (TryRuby):1: unterminated string meets end of file
(TryRuby):1: syntax error, unexpected $end, expecting ')'
reset
=> nil
back
def load_comics(path)
.. comics = {}
.. File.foreach(path) do |line|
.. name, url = line.split(': ')
.. comics[name] = url.strip
.. end
.. comics
.. end
=> nil
comics = load_comics('/comics.txt')
NameError: undefined local variable or method ticket' for main:Object comics = load_comics('/comics.txt') NameError: undefined local variable or methodticket' for main:Object

Sophrinix commented 14 years ago

its back up