Home > rails syntax > rails syntax error unexpected kend

Rails Syntax Error Unexpected Kend

here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up About Ruby error 'kEnd'? up vote 3 down vote favorite I'm having a lot of trouble with Ruby after coming back to it from a long break. I'm getting a lot of 'unexpected kEND' errors, and I've tracked it down to lines below. I'm not having trouble with a particular piece of code, but rather, the concept of 'unexpected kEND' . if (condition) do-one-line-thing() and # inside of a loop... if ( condition-evaluation-that-might-cause-error-during-run-time ) do-something() end and myarray.each { |element| do-soemthing-that-might-cause-error-during-run-time-for-some-but-not-all-values() } Question : What other things can cause these kEND errors ? It seems like kEND is being used as a general "Badness on line ##" error? What can you tell me about kEND errors in general? ruby share|improve this question asked Sep 29 '10 at 23:04 rlb.usa 8,2031152104 add a comment| 2 Answers 2 active oldest votes up vote 3 down vote accepted an unexpected kEND is where the end keyword was found somewhere it shouldn't be. Generally you've closed too many code blocks, or you've got some other syntax problem. If you paste a (complete) file which has this problem we can point out the error... share|improve this answer answered Sep 29 '10 at 23:09 Gareth 65.3k23122139 Right, but, in my code, which has no syntax problems, when there is an error inside evaluation/execution, I seem to get a kEnd error, rather than a message like 'error: can't cast nil to specific type!', so I'm asking to find out more about this odd seemingly odd error... –rlb.usa Sep 29 '10 at 23:12 unexpected kEND is a syntax error. Pastebin an entire file which has this problem and we'll

here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up syntax error, unexpected kEND [closed] up vote 0 down vote favorite def read_dbf(paste) #Lendo a pasta Dir.foreach(paste) { |name| if(File.directory?(name)) pasteSub = paste+"/"+name Dir.foreach(pasteSub) { http://stackoverflow.com/questions/3826525/about-ruby-error-kend |subname| puts "Pasta: #{pasteSub}" puts subname } end end } end end Error: syntax error, unexpected kEND I tried to create a block within a block and I think given problem. I am listing the contents of the folder and case folder for the content they access and read the contents of the folder as well. Problem happened when I put the "if" ruby-on-rails ruby jruby share|improve this question asked Jun 8 '15 at 22:55 Daniel http://stackoverflow.com/questions/30720412/syntax-error-unexpected-kend Bastos 236 closed as off-topic by Jörg W Mittag, mu is too short, jvnill, Wayne Conrad, infused Jun 9 '15 at 17:21 This question appears to be off-topic. The users who voted to close gave this specific reason:"This question was caused by a problem that can no longer be reproduced or a simple typographical error. While similar questions may be on-topic here, this one was resolved in a manner unlikely to help future readers. This can often be avoided by identifying and closely inspecting the shortest program necessary to reproduce the problem before posting." – Jörg W Mittag, mu is too short, jvnill, Wayne Conrad, infusedIf this question can be reworded to fit the rules in the help center, please edit the question. You have too many end statements. Remove the last one. –infused Jun 8 '15 at 23:41 add a comment| 1 Answer 1 active oldest votes up vote 0 down vote accepted Yes, you add if and miss some end there. Try to use some editor for show you unexpected end. def read_dbf(paste) #Lendo a pasta Dir.foreach(paste) {|name| if File.directory?(name) pasteSub = paste+"/"+name Dir.foreach(pasteSub) {|subname| puts "Pasta: #{pasteSub}" puts subname } end } end share|improve this answer edited Jun 9 '15 at 7:38 answered Jun 8 '15 at 22:59 Lukas Baliak 1,455717 2 Please add some explanation to avoid de

here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and http://stackoverflow.com/questions/16878896/line-357-syntax-error-unexpected-kend-expecting-end policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only rails syntax takes a minute: Sign up “Line 357: syntax error, unexpected kEND, expecting $end” [closed] up vote -5 down vote favorite 1 This is my code. can you please help me to understand the error "Line 357: syntax error, unexpected kEND, expecting $end" I am new to Ruby. Read many tutorials and developed this code. $guess=0 $j=0 $ans = "" def questions(no) rails syntax error case no when 1 puts "\nWhat is 1+1 ? " puts "\n\na) 2 \tb) 3\t c) 4\n" puts "\nInput your answer a or b or c: " ans = gets.chomp if ans.casecmp("A") == 0 puts "\n\t\tWrong :o :o :o" guess=guess+1 return 1 else puts "\n\t\tCorrect!!!" return 0 end when 2 puts "\nWhat is a OS ? " puts "\n\na) XP\tb) PX\t c) UI\n" puts "\nInput your answer a or b or c: " ans = gets.chomp if ans.casecmp("A") == 0 puts "\n\t\tWrong :o :o :o" guess=guess+1 return 1 else puts "\n\t\tCorrect!!!" return 0 end when 3 puts "\nWhat is 1+2 ? " puts "\n\na) 2 \tb) 3\t c) 4\n" puts "\nInput your answer a or b or c: " ans = gets.chomp if ans.casecmp("B") == 0 puts "\n\t\tWrong :o :o :o" guess=guess+1 return 1 else puts "\n\t\tCorrect!!!" return 0 end when 4 puts "\nWhat is 1+3 ? " puts "\n\na) 2 \tb) 3\t c) 4\n" puts "\nInput your answer a or b or c: " ans = gets.chomp if ans.casecmp("C") == 0 puts "\n\t\tWrong :o :o :o" guess=guess+1 return 1

 

Related content

rails syntax error unexpected $end expecting kend

Rails Syntax Error Unexpected end Expecting Kend p here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies relatedl of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of million programmers just like you helping each other Join them it only takes a minute Sign up Unexpected end expecting kEND

rails syntax error unexpected kend expecting $end

Rails Syntax Error Unexpected Kend Expecting end p here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow relatedl the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of million programmers just like you helping each other Join them it only takes a minute Sign up Ruby unexpected kEND expecting

rails syntax error unexpected tassoc expecting kend

Rails Syntax Error Unexpected Tassoc Expecting Kend p here for a quick overview of the site Help Center Detailed answers to any questions relatedl you might have Meta Discuss the workings and policies ruby tassoc of this site About Us Learn more about Stack Overflow the company ruby hash Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of million programmers just like you helping each other Join them it only takes a minute Sign up

rails syntax error reserved word function

Rails Syntax Error Reserved Word Function table id toc tbody tr td div id toctitle Contents div ul li a href Coffee Script a li li a href Coffeescript Vs Javascript a li ul td tr tbody table p here for a quick overview of the site Help Center Detailed answers to any questions you relatedl might have Meta Discuss the workings and policies of this convert js to coffee site About Us Learn more about Stack Overflow the company Business Learn javascript in rails more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags

rails syntax error unexpected tassoc

Rails Syntax Error Unexpected Tassoc p here for a quick overview of the site Help relatedl Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of million programmers just like you helping each other Join them it only takes a minute Sign up Syntax error unexpected tASSOC expecting keyword