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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T13:43:28+00:00 2026-05-23T13:43:28+00:00

I am trying to connect to the RubyGems API , but when I try

  • 0

I am trying to connect to the RubyGems API, but when I try to get the JSON I get an stange error.

Uncaught SyntaxError: Unexpected token :

I have seen this error in other questions and posts, but none of the worked for me.

Here is my $.getJSON() function

.getJSON("http://rubygems.org/api/v1/gems/rails.json?jsoncallback=?", function(data) {
  ...function stuff....
});

This is the JSON that I should receive:

{"dependencies":{"runtime":[{"name":"actionmailer","requirements":"= 3.0.9"},{"name":"actionpack","requirements":"= 3.0.9"},{"name":"activerecord","requirements":"= 3.0.9"},{"name":"activeresource","requirements":"= 3.0.9"},{"name":"activesupport","requirements":"= 3.0.9"},{"name":"bundler","requirements":"~> 1.0"},{"name":"railties","requirements":"= 3.0.9"}],"development":[]},"name":"rails","downloads":4474748,"info":"Ruby on Rails is a full-stack web framework optimized for programmer happiness and sustainable productivity. It encourages beautiful code by favoring convention over configuration.","version_downloads":93309,"version":"3.0.9","homepage_uri":"http://www.rubyonrails.org","bug_tracker_uri":"http://rails.lighthouseapp.com/projects/8994-ruby-on-rails","source_code_uri":"http://github.com/rails/rails","gem_uri":"http://rubygems.org/gems/rails-3.0.9.gem","project_uri":"http://rubygems.org/gems/rails","authors":"David Heinemeier Hansson","mailing_list_uri":"http://groups.google.com/group/rubyonrails-talk","documentation_uri":"http://api.rubyonrails.org","wiki_uri":"http://wiki.rubyonrails.org"}

Can someone please help me 🙂

  • 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-23T13:43:28+00:00Added an answer on May 23, 2026 at 1:43 pm

    What makes you think that rubygems.org supports JSONP at all? I don’t see any mention of JSONP in the documentation and when I do this:

    lynx -dump -source 'http://rubygems.org/api/v1/gems/rails.json?jsoncallback=x'
    

    I get the same plain old JSON as I do from

    lynx -dump -source 'http://rubygems.org/api/v1/gems/rails.json'
    

    The only difference between the two is the downloads and version_downloads change but that’s to be expected.

    When you use jsoncallback=? in the query string, jQuery will set up a callback function and assume that the remote URL will send back JavaScript (not JSON!) that will call the specified function. So, if the remote service sends back JSON when you’re expecting JavaScript, the browser will end up trying to interpret the JSON as JavaScript and get upset because

    {"dependencies":{"runtime":[{"name":"action ...
    

    is not a valid JavaScript statement. This sounds exactly like the error you’re seeing.

    I think you’re going to have to proxy the JSON through your own server. You’ll need a controller on your server that makes that makes the call to get the JSON and then simply echoes it back to your JavaScript, this will get your around both the lack of JSONP support and your cross domain problem in your client.

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

Sidebar

Related Questions

I'm trying to connect to the linkedin API using the linkedin gem. I have
When trying to connect to EC2 over SSH I get the following error: joshua-scotts-macbook-pro:.ec2
I'm trying to connect a GtkAction signal to the callback open_file but apparently I
Trying to connect to a SQL Server 2005 instance remotely but getting the following
When trying to connect to a server, my app does not have a very
Am trying to connect the App Delegate to the View Controller in Xcode4, but
Im trying to connect to a mysql database on my web server, but I
I'm trying to connect from a Windows XP system to an SVN server but
I have been trying to connect to mysql all evening using PHP. I know
I am trying to connect to Oracle DB using JDBC. I have put ojdbc.jar

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.