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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T20:19:03+00:00 2026-06-04T20:19:03+00:00

Here is an weird situation, hope you can help me with a reason: require

  • 0

Here is an weird situation, hope you can help me with a reason:

require "open-uri"

class TraceParser
  def starttorip
    url = 'http://yahoo.com'
    proxy_addr = 'http://my proxy server:'
    proxy_port = 1010
    begin
      open(url, :proxy => (proxy_addr + proxy_port.to_s)) do |source|
        source.each_line do |x|
          puts x
        end
      end
    end
  end
  varb = TraceParser.new
  varb.starttorip
end

Above code works like a charm, and everything is rosy. But, when I change the proxy definition to something like this:

require "open-uri"
class TraceParser
  def starttorip
    url = 'http://yahoo.com'
    begin
      open (url, :proxy => 'http://my proxy server:1010') do |source|
        source.each_line do |x|
          puts x
        end
      end
    end
  end
  varb = TraceParser.new
  varb.starttorip
end

Everything breaks loose:

/tracerparser.rb:6: syntax error, unexpected ',', expecting ')' (SyntaxError)
      open (url, :proxy => "my proxy server...

From what I understand, the first one is splitting proxy defn into two strings and appending to the open gem. Thanks for sharing your inputs.

  • 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-04T20:19:06+00:00Added an answer on June 4, 2026 at 8:19 pm

    The problem is the space after the open, it has nothing to do with the proxy map entry.

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

Sidebar

Related Questions

I am confronted to a weird situation that I can't explain. Here is my
Here's the situation. function scrollLog(line) { // Assume Firefox // alert(weird); frames['log'].find(line); }; Here's
Hi this may seem like a weird question, but here's my situation: I have
There is a weird code here that I need to make work.. can you
I have this weird situation. I have these two classes: Public Class Entry End
I'm having a bit of a weird situation here. I have a form that
I am new to this site, I hope you can help. I get an
I'm having really weird situation. I create a singletone object of a class named
I have a pretty weird situation here, and i came up with a very
I don't know it may sound weird... but here is my situation... I have

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.