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

  • Home
  • SEARCH
  • 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 7401255
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T04:24:59+00:00 2026-05-29T04:24:59+00:00

I am using this very nice LinkedIn ruby gem (https://github.com/pengwynn/linkedin) for a project of

  • 0

I am using this very nice LinkedIn ruby gem (https://github.com/pengwynn/linkedin) for a project of mine, and have got stuck at a very painful point for the past 1 day.

I’m doing a people search and using nested field selector for the “people” resource. My query looks something like this :

@client.search(:fields => [ { :people => %w(id first-name api-standard-profile-request) } ], :keywords => 'some keywords')

and am getting a bad URI exception

bad URI(is not URI?): /people-search:({:people=>["id", "first-name", "api-standard-profile-request"]})

Of course this is not what the URL should be like. It should be like

/people-search:(people:(id,first-name,api-standard-profile-request))

After spending some time on github and going through the code, I could understand how the path is been generated by the gem. In the search.rb file :

def field_selector(fields)
    result = ":("
    fields = fields.to_a.map do |field|
      if field.is_a?(Hash)
        innerFields = []
        field.each do |key, value|
          innerFields << key.to_s.gsub("_","-") + field_selector(value)
        end
        innerFields.join(',')
      else
        field.to_s.gsub("_","-")
      end
    end
    result += fields.join(',')
    result += ")"
    result
  end

where fields is the array that I’m passing to the search method.

The strange part is, that when I run this piece of code (field_selector method) in the console, with my fields array as input, I get the desired output !

I’m totally lost as to why I’m getting the error, and have no idea how to go about fixing it. Any pointers would be awesome !

Thanks !

  • 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-29T04:25:00+00:00Added an answer on May 29, 2026 at 4:25 am

    Your code worked for me. Try upgrading your gem to the 2-0 branch. Add this to your gem file:
    gem ‘linkedin’, :git => ‘http://github.com/pengwynn/linkedin.git’, :branch => ‘2-0-stable’

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

Sidebar

Related Questions

I have this very simple example that I am using to learn structs in
I am using this jQuery plugin It is very nice, but I can't seem
Using the very nice signalR library, I have a broadcast message that sends an
http://www.gmarwaha.com/jquery/jcarousellite/?#demo Hi, jcarousellite is a very nice jquery extension. I am using it for
I have a very nice MVC Beta application developed using VS2008 on a win2008
A VERY nice to have would be if I could edit object-literals in this
So I have this grid. It's a very nice grid. Lovely, really. Except when
Starting from this very nice article about doing facebook integration using the javascript API
I'm using this jQuery urlencode and urldecode plugin - very simple and easy to
I deployed an application using this method and it worked very good. However, there

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.