Questions tagged [curb]

Curb provides Ruby-language bindings for the libcurl, a fully-featured client-side URL transfer library.

Curb provides Ruby-language bindings for the libcurl, a fully-featured client-side URL transfer library. See https://github.com/taf2/curb

125 questions
58
votes
8 answers

Can't find libcurl or curl/curl.h (RuntimeError)

I am trying to install curb 0.8.0 on a Windows computer but I can not seem to get anywhere. I have been trying every website 3 pages deep on my Google search. Please, anyone have an idea of how I can get this single thing installed. I have…
MrMortales
  • 647
  • 1
  • 7
  • 7
28
votes
4 answers

An error occurred while installing curb (0.8.5)

While bundling an old project, this error came up: Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension. /home/dd/.rvm/rubies/ruby-2.0.0-p247/bin/ruby extconf.rb checking for curl-config... no checking for main()…
dax
  • 10,779
  • 8
  • 51
  • 86
23
votes
3 answers

Can't Install Curb - Having problems with native extensions.

I'm trying to install the curb gem on my Debian machine but I'm having a hard time building the gem with native extensions. I'm using RVM. Just a list of things I'm using: debian bundler rvm ruby-1.9.2-p180 curb I'm told I have to install the…
Andrew WC Brown
  • 2,240
  • 5
  • 22
  • 24
13
votes
1 answer

Get response headers from Curb

I intend to make a call from a Ruby on Rails application: c = Curl::Easy.http_post("https://example.com", json_string_goes_here) do |curl| curl.headers['Accept'] = 'application/json' curl.headers['Content-Type'] = 'application/json' …
Mike Malloy
  • 1,520
  • 1
  • 15
  • 19
10
votes
1 answer

Ruby: How do I send a JSON POST request using Curb?

How can I set the request body of a CURB request to be my json string? I am trying to do a JSON POST request using Curb. My code: require 'rubygems' require 'curb' require 'json' myarray = {} myarray['key'] = 'value' json_string =…
Marco
  • 4,345
  • 6
  • 43
  • 77
8
votes
2 answers

ruby incompatible curb version

I installed the curb gem by: gem install curb But when i include in my ruby code by require 'curb', it gives the following error /Users/vishrutmehta/.rvm/gems/ruby-1.9.3-p448/gems/curb-0.8.5/lib/curl.rb:1:in `require'"…
user2795267
  • 81
  • 1
  • 2
8
votes
1 answer

Ruby/Rails Performance: OpenURI vs NET:HTTP vs Curb vs Rest-Client

I'm accessing different servers for data and I tried different methods in different classes, using the basic http::net, curb, rest-client and open-uri (1) How to measure performance in Ruby / Rails in General? (2) Which method do you think is…
user1781626
7
votes
6 answers

Why is curl in Ruby slower than command-line curl?

I am trying to download more than 1m pages (URLs ending by a sequence ID). I have implemented kind of multi-purpose download manager with configurable number of download threads and one processing thread. The downloader downloads files in…
Stiivi
  • 2,077
  • 2
  • 16
  • 27
5
votes
2 answers

Rails - loop curls request eating memory

I use the gem Curb (tried too with httparty) to performing a lot of http request and this working good. But in one of my (rake) task (where I do 20k+ requests) I have a memory problem (Rails "eats" more than 2GB of RAM until there is no free memory…
damoiser
  • 6,058
  • 3
  • 40
  • 66
5
votes
2 answers

Retrieving full request string using Ruby curl

I intend to send a request like the following: c = Curl::Easy.http_post("https://example.com", json_string ) do |curl| curl.headers['Accept'] = 'application/json' curl.headers['Content-Type'] = 'application/json' …
Mike Malloy
  • 1,520
  • 1
  • 15
  • 19
5
votes
1 answer

How do i add binary-data to curb POST

I'm trying to do the following POST to Parse Cloud using the Curb gem curl -X POST \ -H "X-Parse-Application-Id: PARSE_APP_ID" \ -H "X-Parse-REST-API-Key: PARSE_API_KEY" \ -H "Content-Type: image/jpeg" \ --data-binary '@myPicture.jpg' \ …
haider
  • 2,418
  • 3
  • 24
  • 26
4
votes
2 answers

How do I make bundler recognize installed curb gem?

I've successfully installed the curb gem on Mac OS X using sudo env ARCHFLAGS="-arch x86_64" gem install curb but when trying to run bundle install I still get this error: Installing curb (0.7.16) with native extensions…
4
votes
2 answers

Zipfile download through CURL to an actual Zip-file in your file structure

I am trying to build a file downloader with the RubyGem Curb. (Look at This Question.) I am trying to download a zip file and then with the class File I am trying to actually make the file so that I can double click it in Finder (I am on OS X). How…
maetthew
  • 191
  • 2
  • 14
4
votes
2 answers

Mock out Curl::Easy.perform? (in Curb)

Is there a way to mock out Curb's Easy.perform method for unit testing? I use this to hit Facebook's graph API, and none of the http mock libs seem to support Curb. What's the best approach here?
Josiah Kiehl
  • 3,593
  • 3
  • 26
  • 28
4
votes
1 answer

SSL peer certificate or SSH remote key was not OK (Curl::Err::SSLPeerCertificateError)

I got the error on ubuntu but works on mac But if I run the curl command on ubuntu , it works. is curb a buggy gem? 2.1.0/gems/curb-0.8.6/lib/curl/easy.rb:72:in `perform': SSL peer certificate or SSH remote key was not OK…
newBike
  • 14,385
  • 29
  • 109
  • 192
1
2 3
8 9