Home > rails syntax > rails syntax error unexpected kend expecting $end

Rails Syntax Error Unexpected Kend Expecting $end

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 Ruby unexpected kEND, expecting $end up vote 1 down vote favorite require 'open-uri' print "Enter a URL" add = gets open(#{add}) do |f| j = f.read.scan(/

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 http://stackoverflow.com/questions/10078316/ruby-unexpected-kend-expecting-end each other. Join them; it only takes a minute: Sign up Ruby unexpected $end, expecting kEND up vote -1 down vote favorite I am getting the following error: unexpected $end, expecting kEND Does rescue require end? How about begin? Am I missing an end somewhere? class AdAssistedController < CommonController def initialize super @pageJs = ['ad_assisted'] @pageCSS = ['ad_creator', http://stackoverflow.com/questions/18979216/ruby-unexpected-end-expecting-kend 'fbx_launcher', 'score_dashboard', 'slider_dashboard_new', 'score-dashboard_new', 'jquery-ui'] end def index begin @feed_names = FbxLauncher::Feed.find(:all) rescue Exception => e log_error(e.message) log_error(e.backtrace) end respond_to do |format| format.js { render :partial => 'index'} format.html { render :partial => 'index'} end end ruby-on-rails ruby share|improve this question edited Sep 24 '13 at 10:38 Mischa 33.6k77194 asked Sep 24 '13 at 10:33 nnm 3051419 You need an end to match the class. The block starting begin needs a single end, a more complete (though not exhaustive) syntax precis might be begin...rescue...ensure...end –Neil Slater Sep 24 '13 at 10:34 add a comment| 3 Answers 3 active oldest votes up vote 0 down vote You are missing an end for your class. share|improve this answer answered Sep 24 '13 at 10:35 Steve Robinson 1,98721734 add a comment| up vote 0 down vote Try to use consistent tags/spaces when you write your code. And there is one "end" missing in the end of your file (that kEND) means. class AdAssistedController < CommonController def initialize super @pageJs = ['ad_assisted'] @pageCS

here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies http://stackoverflow.com/questions/8317860/syntax-error-unexpected-kend-expecting-end-while-executing-a-daemon 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: rails syntax Sign up “syntax error, unexpected kEND, expecting $end” while executing a daemon up vote 0 down vote favorite UPDATED: I used daemon_generator in a Rails 2.3 app to create a daemon. Per Jeff Perrin's suggestions below i created the following configuration. I updated this question with the final solution for others that are struggling to get a daemon working. For debugging purposes rails syntax error I cut my lib/pulse_check_email.rb file down to this: class PulseCheckEmail def self.send_pulse_check_mail # removed all conditional statements and other "stuff" to debug end end My lib/daemons/mailer.rb file: require File.dirname(__FILE__) + "/../../config/environment" require 'pulse_check_email' while($running) do PulseCheckEmail.send_pulse_check_mail sleep 300 # 5 min end Thanks for your help! ruby-on-rails daemon share|improve this question edited Dec 1 '11 at 4:52 asked Nov 29 '11 at 21:17 Jay 2,75283568 add a comment| 1 Answer 1 active oldest votes up vote 1 down vote accepted Regardless of whether you can call a controller method from a daemon in your Rails application, this is not something I would recommend. I would suggest that you extract the code that is currently in the send_mail action of the controller into a separate class (that could be put in the /lib directory as well). Then you can call that code from both your daemon and your controller. class YourController < ApplicationController def create do_stuff send_email end def send_email ExtractedClass.do_stuff(params) end end #new class in lib/extracted_class.rb class ExtractedClass def self.do_stuff(params) #put the code that was previously in the send_email #function of your controller end

 

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

Rails Syntax Error Unexpected Kend p here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss relatedl 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 About Ruby error 'kEnd' up vote

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