Tag: libcurl

使用Ruby Curb传递GET参数

我正在尝试使用Curb(curb.rubyforge.org)来调用需要在get请求中提供的参数的RESTful API。 我想获取像http://foo.com/bar.xml?bla=blablabla这样的url。 我希望能够做类似的事情 Curl::Easy.perform(“http://foo.com/bar.xml”, :bla => ‘blablabla’) {|curl| curl.set_some_headers_if_necessary } 但到目前为止,我能看到的唯一方法是在URL中手动包含?bla=blablabla并自己进行编码。 当然有一种正确的方法可以做到这一点,但我无法弄清楚阅读文档。

安装libCurl – ruby​​ 1.9.3 .. rails 3.2.12 .. Windows

所以,我正在尝试让feedzirra运行起来… ruby 1.9.3p448 Rails 3.2.12 我去了http://curl.haxx.se/download.html#Win32并下载了Win32 2000/XP 7.32.0 libcurl SSL 。 这可能是显而易见的,但这是libcurl -v 7.32 。 我将上述文件解压缩到c:\libcurl (所以bin,lib和whatnot直接在libcurl中)。 我将c:\libcurl\bin到PATH 。 在我的应用程序的工作目录中,我告诉bundler在哪里可以找到cURL依赖项与bundle config build.curb –with-curl-lib=C:\libcurl\bin –with-curl-include=C:\libcurl\include 。 我在我的gemfile中将nokogiri的版本设置为gem ‘nokogiri’, ‘~> 1.5.3’ ,因为它不喜欢当前的-v 1.6.0。 这将安装nokogiri -v 1.5.10 。 我在我的gemfile中将feedzirra的版本设置为gem ‘feedzirra’, github: ‘pauldix/feedzirra’, ref: ’80cd357′ 。 这会安装一些依赖项: 使用路缘石(0.8.4) – 尝试gem ‘curb’, ‘0.8.1’和gem ‘curb’, ‘~> 0.7.15’并不能解决问题,只是抬头 使用丝瓜络(1.2.1) 使用sax-machine(0.2.0.rc1) 使用来自git://github.com/pauldix/feedzirra.git(80cd357)的feedzirra(0.2.0.rc2) – […]

如何在Windows 7 64bit上安装libcurl

安装时出现以下错误: C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/json_web_token-0.3.2/lib/json_web_token.rb:36: warning: already initialized constant JWT C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/jwt-1.5.6/lib/jwt/json.rb:4: warning: previous definition of JWT was here rake aborted! LoadError: Could not open library ‘libcurl’: The specified module could not be found. . Could not open library ‘libcurl.dll’: The specified module could not be found. . Could not open library ‘libcurl.so.4’: The specified module could not be […]

在Mac Snow Leopard上遇到Curb gem的问题

这耗费了我几个小时的时间。 在控制台中我运行:require’curb’ 我收到错误: 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/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require’ from /Users/user/Sites/CSG/vendor/rails/activesupport/lib/active_support/dependencies.rb:156:in `require’ from /Users/user/Sites/CSG/vendor/rails/activesupport/lib/active_support/dependencies.rb:521:in `new_constants_in’ from /Users/user/Sites/CSG/vendor/rails/activesupport/lib/active_support/dependencies.rb:156:in `require’ from /usr/local/lib/ruby/gems/1.8/gems/taf2-curb-0.5.4.0/lib/curb.rb:1 from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require’ from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `require’ from /Users/user/Sites/CSG/vendor/rails/activesupport/lib/active_support/dependencies.rb:156:in `require’ from /Users/user/Sites/CSG/vendor/rails/activesupport/lib/active_support/dependencies.rb:521:in `new_constants_in’ from /Users/user/Sites/CSG/vendor/rails/activesupport/lib/active_support/dependencies.rb:156:in `require’ from ./lib/tokbox/base_api.rb:7 我已经尝试卸载gem并使用ARCHFLAGS =“ – […]

在Windows XP中安装Ruby Curb gem

我正在尝试使用ruby 1.8进行文件上传,似乎没有好的开箱即用的解决方案。 他们似乎都需要一些第三方补丁或项目分支来工作。 我会使用机械化,但实际上我需要与xml api接口,而机械化似乎专门用于直接处理网页。 我已经尝试过RestClient但它没有开箱即用的多部分表单的function,你必须使用项目的分支才能使它工作。 类似的情况似乎存在于Net:HTTP我认为遏制将是要走的路,因为我可能想要使用multicurl反正我计划做的其他事情。 但是,在我的Windows机器上,我似乎无法安装路边gem。 gem install curb给出一个错误,说我需要指定curl库所在的位置..我已经尝试将选项传递给extconf但到目前为止没有运气。 这是没有任何选项的gem install curb的输出 C:\ruby\lib\ruby\gems\1.8\gems\curb-0.5.4.0>gem install curb Building native extensions. This could take a while… ERROR: Error installing curb: ERROR: Failed to build gem native extension. C:/ruby/bin/ruby.exe extconf.rb checking for curl-config… no checking for main() in curl.lib… no *** extconf.rb failed *** Could not create […]