Rails Syntax Error Unexpected $end
Contents |
here syntax error, unexpected end-of-input, expecting keyword_end ruby for a quick overview of the site
Vagrant Syntax Error, Unexpected End-of-input, Expecting Keyword_end
Help Center Detailed answers to any questions you might have Meta Discuss vagrant unexpected end-of-input, expecting keyword_end the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more
Syntax Error, Unexpected '{', Expecting $end
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 syntax error, unexpected keyword_ensure, expecting keyword_end other. Join them; it only takes a minute: Sign up rails syntax error.. unexpected end up vote -4 down vote favorite Getting the following error: SyntaxError in FriendsController#index /Users/nelsonkeating/Desktop/ReminDeal/app/controllers/friends_controller.rb:32: syntax error, unexpected keyword_end, expecting ')' /Users/nelsonkeating/Desktop/ReminDeal/app/controllers/friends_controller.rb:58: syntax error, unexpected $end, expecting keyword_end Rails.root: /Users/nelsonkeating/Desktop/ReminDeal Application Trace | Framework Trace | Full Trace activesupport (3.2.3) lib/active_support/dependencies.rb:469:in `load' activesupport (3.2.3) lib/active_support/dependencies.rb:469:in `block in load_file' activesupport (3.2.3) lib/active_support/dependencies.rb:639:in `new_constants_in' activesupport (3.2.3) lib/active_support/dependencies.rb:468:in `load_file' activesupport (3.2.3) lib/active_support/dependencies.rb:353:in `require_or_load' activesupport (3.2.3) lib/active_support/dependencies.rb:502:in `load_missing_constant' activesupport (3.2.3) lib/active_support/dependencies.rb:192:in `block in const_missing' activesupport (3.2.3) lib/active_support/dependencies.rb:190:in `each' activesupport (3.2.3) lib/active_support/dependencies.rb:190:in `const_missing' activesupport (3.2.3) lib/active_support/inflector/methods.rb:229:in `block in constantize' activesupport (3.2.3) lib/active_support/inflector/methods.rb:228:in `each' activesupport (3.2.3) lib/active_support/inflector/methods.rb:228:in `constantize' activesupport (3.2.3) lib/active_support/dependencies.rb:554:in `get' actionpack (3.2.3) lib/action_dispatch/routing/route_set.rb:69:in `c
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
Unterminated String Meets End Of File
Stack Overflow the company Business Learn more about hiring developers or posting ads
Ruby Syntax Checker
with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow ruby end is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up rails error: syntax error unexpected end of input up vote -1 down vote http://stackoverflow.com/questions/10803928/rails-syntax-error-unexpected-end favorite def create @diary = Diary.find(params[:diary_id]) @diary_page = @diary.diary_pages.create(params[:diary_page].permit(:text)) redirect_to diary_path(@diary) end Hi above is my controller method create. It is giving me following error. diary_pages_controller.rb:20: syntax error, unexpected end-of-input ����@diary = Diary.find(params[:diary_id]) ^ Can somebody help? ruby-on-rails ruby-on-rails-4 syntax-error share|improve this question asked Nov 6 '13 at 8:04 riship89 2,736103689 Could you show your all diary_pages_controller.rb file? –Marek Lipka Nov 6 '13 at 8:10 Maybe http://stackoverflow.com/questions/19806836/rails-error-syntax-error-unexpected-end-of-input an encoding issue? Do you have tabs instead of spaces in your controller? –sebbo Nov 6 '13 at 8:45 @sebbo: how does tabs/spaces matter? in Ruby only line breaks are checked. –riship89 Nov 6 '13 at 21:46 Just thought that because of the strange error message something is wrong with the first two characters of line 20 of your controller. So maybe instead of spaces - your text editor/IDE placed something else there. –sebbo Nov 7 '13 at 10:26 add a comment| 1 Answer 1 active oldest votes up vote 0 down vote accepted This was such a dumb question. My editor added some bad characters at the beginning of the line. Fixed the error by re-indenting the line. share|improve this answer answered Nov 10 '13 at 8:58 riship89 2,736103689 add a comment| Your Answer draft saved draft discarded Sign up or log in Sign up using Google Sign up using Facebook Sign up using Email and Password Post as a guest Name Email Post as a guest Name Email discard By posting your answer, you agree to the privacy policy and terms of service. Not the answer you're looking for? Browse other questions tagged ruby-on-rails ruby-on-rails-4 syntax-error or ask your
unexpected end-of-input, expecting keyword_end In the Ruby foundation example video one of the examples involves building a speech class , but everytime I https://teamtreehouse.com/community/syntax-error-unexpected-endofinput-expecting-keywordend run the program i get the following error - "syntax error, unexpected end-of-input, expecting keyword_end" here's my speech-example.rb code. class Speech def initialize print "What is the speech name? " @title = gets.chomp @lines = [] while add_line puts "Line added." end end def title @title end def add_line puts "Add a line: (blank line to exit)" line = syntax error gets.chomp if line.length > 0 @lines.push line return line else return nil end def each(&block) @lines.each { |line| yield line} end end speech = Speech.new speec.each do |line| puts "[#{speech.title}] @{line}" end Oh, I'm also running the following version of Ruby - ruby 2.1.2p95 Thanks guys 2 Answers MOD Michael Hulet Treehouse Moderator 34,791 Points Michael Hulet Michael Hulet Treehouse syntax error, unexpected Moderator 34,791 Points over 2 years ago You're missing and end to close out your add_line method. This code works: class Speech def initialize print "What is the speech name? " @title = gets.chomp @lines = [] while add_line puts "Line added." end end def title @title end def add_line puts "Add a line: (blank line to exit)" line = gets.chomp if line.length > 0 @lines.push line return line else return nil end #You were missing the end statement right here end def each(&block) @lines.each { |line| yield line} end end speech = Speech.new speec.each do |line| puts "[#{speech.title}] @{line}" end PRO Hoormazd Kia Pro Student 6,075 Points Hoormazd Kia Hoormazd Kia Pro Student 6,075 Points over 2 years ago Thanks. guess I was just tired :) Posting to the forum is only allowed for members with active accounts. Please sign in or sign up to post. Our mission is to bring affordable, technology education to people everywhere, in order to help them achieve their dreams and change the world. Our Company About Us Contact Us Community