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 7587181
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T19:36:33+00:00 2026-05-30T19:36:33+00:00

I am getting Ruby Error: syntax error, unexpected tGVAR, expecting $end. I am using

  • 0

I am getting Ruby Error: syntax error, unexpected tGVAR, expecting $end.

I am using Mechanize to access a website and then I need to enter data into the form to search. When I pp page the site to get the form information I get:

#<Mechanize::Form
<name nil>
<method "POST">
<action "">
<fields
...
...
[text:0xb43f9c type: text name: ct100$MainContent$txtNumber value: ]
...

My code that is throwing this is:

Check_form = page.form()
Check_form.ct100$MainContent$txtNumber = 'J520518'

Any ideas on what is causing the error? Thank you in advance for the help!

  • 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-05-30T19:36:34+00:00Added an answer on May 30, 2026 at 7:36 pm

    Since this is not a valid variable or syntactically valid method name, you should use the alternate method to fetch or assign the values:

    check_form = page.form
    check_form['ct100$MainContent$txtNumber'] = 'J520518'
    

    Variables are of the form @x for class instance variables, @@x for class variables, $x for global variables and x for plain variables, but in all cases the variable must consist of a letter or underscore followed by any number of letters, numbers, or underscores. $ cannot appear anywhere but the beginning, and when it does that means “global variable”, something rarely used in most Ruby programming.

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

Sidebar

Related Questions

I'm getting a lot of syntax errors: SyntaxError: /Users/davidtuite/dev/ruby/seenbefore_client/spec/lib/url_group_spec.rb:40: syntax error, unexpected ':' records
I am getting this error message when I move my Ruby on Rails server
I'm very new to Ruby on Rails, and have been getting the following error
getting a no method error while using clearance for authentication, i was trying to
I'm writing a ruby on rails application, and am getting a compile error for
I'm using Sinatra 1.2.0 with Ruby 1.9.2 (I need to work with this version
I am getting the following error when migrating to Heroku. Installing hoe (2.9.4) /usr/ruby1.9.2/lib/ruby/1.9.1/rubygems/installer.rb:170:in
I'm getting a similar error to this post Ruby on Rails Authlogic password not
I am getting this error when I run my project: C:/InstantRails/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such
immediately after has_many_polymorphs install with ruby script/plugin install git://github.com/fauna/has_many_polymorphs.git i start getting following error

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.