From: Arslan Farooq Date: 2013-06-24T15:02:50+09:00 Subject: Re: Running wordlist.rb code from "why's (poignant) Guide to Ruby" Okay I got it working now: wordlist.rb: ------------ Code_words = { 'Milkshake' => 'See what you mean to me, sweet cakes and milkshakes', 'Strawberry' => 'People moving all the time, inside a perfectly straight line, don\'t you wanna curve away?' } code.rb ------- require '/home/arslan/Work/01-June/ruby/wordlist' # Get the evil idea and swap in code words print "Enter your new idea: " idea = gets Code_words.each do |real, code| idea.gsub!( real, code ) end # Save the jibberish to a new file print "File encoded, Please enter a name for this idea: " idea_name = gets.strip File::open( "idea-" + idea_name + ".txt", "w" ) do |f| f << idea end ------------------------------------- 1: There should be no space between File::open and ( 2: Full file path is needed in the "require" line 3: code_words needs to be changed to Code_words (http://www.ruby-forum.com/topic/1873204) -- Posted via http://www.ruby-forum.com/.