Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8674321
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T19:40:54+00:00 2026-06-12T19:40:54+00:00

syntax error, unexpected $end, expecting keyword_end We’ve all been there! Assuming enough code changed

  • 0

syntax error, unexpected $end, expecting keyword_end

We’ve all been there! Assuming enough code changed that a quick glance at git diff or the like doesn’t make it obvious, is there an easy way to find that missing end (short of switching to an indentation-based language like Python)?

FWIW, I use Sublime Text 2 as my editor.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T19:40:56+00:00Added an answer on June 12, 2026 at 7:40 pm

    If you’re using Ruby 1.9, try the -w flag when running your ruby program.

    # t.rb
    class Example
      def meth1
        if Time.now.hours > 12
          puts "Afternoon"
      end
      def meth2
        # ...
      end
    end
    
    ruby t.rb  
    => t.rb:10: syntax error, unexpected $end, expecting keyword_end
    
    ruby -w t.rb
    => t.rb:5: warning: mismatched indentations at 'end' with 'if' at 3
       t.rb:9: warning: mismatched indentations at 'end' with 'def' at 2
       t.rb:10: syntax error, unexpected $end, expecting keyword_end
    

    Source:

    http://pragdave.blogs.pragprog.com/pragdave/2008/12/ruby-19-can-check-your-indentation.html

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In the following script I get an error: syntax error: unexpected end of file
Hey guys! I keep getting a syntax error (unexpected $end), and I've isolated it
I'm getting $ syntax error, unexpected keyword_class, expecting keyword_do or '{' or '(' in
i'm getting this error: Parse error: syntax error, unexpected T_PRINT, expecting T_STRING in /homepages/26/d94605010/htdocs/lz/writecodeonline.com/php/index.php(190)
See also SO 1664677 I get this error 2: Syntax error: ( unexpected when
Parse error: syntax error, unexpected '?' error points to after .css : echo '<fb:recommendations
This is the error: Parse error: syntax error, unexpected '}' in /home/idghosti/public_html/testground/mma/include/footer.php on line
I am receiving a parse error which is this: Parse error: syntax error, unexpected
I'm getting the following error: Parse error: syntax error, unexpected T_VARIABLE in /home/a4999406/public_html/willingLog.html on
I keep getting the following error: Parse error: syntax error, unexpected T_SL in /home/a4999406/public_html/willingLog.html

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.