curb

Using curb gem and libcurl on Windows

梦想的初衷 提交于 2020-02-06 10:00:20
问题 I am trying to install the curb gem, which is libcurl bindings for Ruby, and of course I need to have "A working (lib)curl installation, with development stuff" installed on my computer. So, I went to the cURL Download Wizard and downloaded this package. But adding the bin into my PATH does not produce improvement and I still get an error when I try to install the curb gem, such as: extconf.rb:19: Can't find libcurl or curl/curl.h (RuntimeError) Even though, curl is already in the PATH. EDIT:

How to specify network interface with Ruby's Faraday?

自闭症网瘾萝莉.ら 提交于 2020-01-05 07:16:11
问题 I'm using Faraday which wraps various adapters, including Net::HTTP, Excon, Typhoeus, Patron, and EventMachine. I would like to specify the network interface (e.g. en0 or en1 ), but I'm not sure how or if it is possible. I'd be open to answers at the Ruby level or the Linux level. Note: According to Making HTTP requests from different network interfaces with Ruby and Curb, this is possible with Curb. 回答1: I think it even is possible to do that with Faraday and Typhoeus: https://github.com

Using gem Curb (curl) to download file

放肆的年华 提交于 2020-01-03 03:49:07
问题 I have understood that I could use the RubyGem Curb to fulfill my needs of curl'ing down a file to my computer. But I cannot figure out how to actually "touch" the file. This is what I have got so far include 'rubygems' include 'curb' curl = Curl::Easy.new('http://wordpress.org/latest.zip') curl.perform I think I understand that perform actually downloads the file. But how can I interact with the file afterwards? Where is it downloaded to? Regards, Mattias 回答1: The file can be accessed with

curb gem installation: bundle install fails, but normal gem install works [closed]

ε祈祈猫儿з 提交于 2019-12-24 01:18:08
问题 This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center. Closed 8 years ago . solved : the openvz container did not have enough memory assigned to it. I could need some help: I want to install the curb gem through bundler. My

Installing libCurl - ruby 1.9.3 .. rails 3.2.12 .. Windows

六眼飞鱼酱① 提交于 2019-12-24 00:49:32
问题 So, I'm trying to get feedzirra up and running... ruby 1.9.3p448 Rails 3.2.12 I went to http://curl.haxx.se/download.html#Win32 and downloaded Win32 2000/XP 7.32.0 libcurl SSL . It may be obvious, but this is libcurl -v 7.32 . I unzipped the aforementioned file into c:\libcurl ( so the bin, lib, and whatnot are directly in libcurl ). I added c:\libcurl\bin to the PATH . While in my app's working directory, I told bundler where to find the cURL dependencies with bundle config build.curb --with

SSLCaertBadFile error heroku curb

女生的网名这么多〃 提交于 2019-12-23 02:57:27
问题 I have a rake task that pulls and parses JSON data over an SSL connection from an external API. I use a gem that wraps this external API and have no problems running locally, but the task fails when run on heroku with #<Curl::Err::SSLCaertBadFile: Curl::Err::SSLCaertBadFile> I installed the piggyback SSL add-on, hoping it might fix it, but no dice. Any ideas? UPDATE I managed to fix it by disabling ssl verification on the curl request previously set by the following two fields: request.ssl

Having Issues with Curb gem on Mac Snow Leopard

☆樱花仙子☆ 提交于 2019-12-22 10:57:13
问题 This has consumed hours of my time. in the console i run: require 'curb' i get the error: LoadError: dlopen(/usr/local/lib/ruby/gems/1.8/gems/taf2-curb-0.5.4.0/lib/curb_core.bundle, 9): no suitable image found. Did find: /usr/local/lib/ruby/gems/1.8/gems/taf2-curb-0.5.4.0/lib/curb_core.bundle: mach-o, but wrong architecture - /usr/local/lib/ruby/gems/1.8/gems/taf2-curb-0.5.4.0/lib/curb_core.bundle from /usr/local/lib/ruby/gems/1.8/gems/taf2-curb-0.5.4.0/lib/curb_core.bundle from /usr/local

Get response headers from Curb

ⅰ亾dé卋堺 提交于 2019-12-18 14:56:54
问题 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' curl.headers['Api-Version'] = '2.2' end The response should have custom headers: X-Custom1 : "some value" X-Custom2 : "another value" How do I iterate over the response headers to compare the values to what I was expecting? 回答1: Using Curl::Easy's header_str you

Performing an HTTP PATCH using Ruby curb

江枫思渺然 提交于 2019-12-13 02:46:55
问题 I'm trying to do an HTTP PATCH using curb. Looking through the code, there doesn't seem to be a method exposed for this. Is there any way to use curb to do a PATCH? If not, what other libraries or methods are there in Ruby to accomplish this? 回答1: With curb latest version (v0.8.1) PATCH is supported even though it is not explicitly available within the Curl::Easy interface (see lib/curl/easy.rb ). You can find a shortcut method here: # see lib/curl.rb module Curl # ... def self.patch(url,

Collect xml response by third party web service

怎甘沉沦 提交于 2019-12-12 05:31:14
问题 I have used this command to send xml files to a web service named SRA-ENA. submission_field = Curl::PostField.content(File.read("xml/#{@experiment.alias}.submission.xml"), 'SUBMISSION') study_field = Curl::PostField.content(File.read("xml/#{@experiment.alias}.study.xml"), 'STUDY') sample_field = Curl::PostField.content(File.read("xml/#{@experiment.alias}.sample.xml"), 'SAMPLE') run_field = Curl::PostField.content(File.read("xml/#{@experiment.alias}.run.xml"), 'RUN') experiment_field = Curl: