Tag: rubygems

安装FeedZirra时出错

我是Ruby on Rails的新手。 我对Feed解析很兴奋,但是当我安装FeedZirra时,我收到了这个错误。 我使用的是Windows 7和Ruby 1.8.7。 请帮忙。 提前致谢。 C:\Ruby187>gem sources -a http://gems.github.com http://gems.github.com added to sources C:\Ruby187>gem install pauldix-feedzirra Building native extensions. This could take a while… ERROR: Error installing pauldix-feedzirra: ERROR: Failed to build gem native extension. C:/Ruby187/bin/ruby.exe extconf.rb checking for curl-config… no checking for main() in -lcurl… no *** extconf.rb failed *** […]

Prawn gem:如何从* existing *文件(.xls)创建.pdf

任何人都可以告诉我(可能复制/粘贴一个简单的代码示例)如何使用Prawn gem从现有 (.xls)文件创建.pdf文件? (基本上,我需要“打开”现有文件的命令。) (我问,因为Prawn文档( http://prawn.majesticseacreature.com/docs/ )似乎已经消失了很长一段时间 – 它甚至无法通过Google缓存使用……) 非常感谢您对此的任何帮助! 汤姆

在Rails中不能要求’nokogiri’(但在irb中工作)

我刚刚开始使用Ruby on Rails,到目前为止它工作得很好。 我现在正在尝试实现一个gem,但它不起作用,我希望它只是一个初学者的错误 – 我尚未掌握的东西! 我已经按照教程并获得了我的hello world示例 – 也设法将git推送到我的Heroku帐户。 我开始按照这里的教程: http : //railscasts.com/episodes/190-screen-scraping-with-nokogiri并在终端中使用以下代码(在mac上) require ‘rubygems’ require ‘nokogiri’ require ‘open-uri’ url = “http://www.walmart.com/search/search-ng.do?search_constraint=0&ic=48_0&search_query=batman&Find.x=0&Find.y=0&Find=Find” doc = Nokogiri::HTML(open(url)) puts doc.at_css(“title”).text 所以这很好用。 我可以在终端内看到标题。 但是,当我尝试将此代码放在我的视图控制器中时,它找不到nokogiri gem。 我的控制器中的代码是 class HomeController < ApplicationController def index require 'rubygems' require 'nokogiri' require 'open-uri' url = "http://www.walmart.com/search/search-ng.do?search_constraint=0&ic=48_0&search_query=batman&Find.x=0&Find.y=0&Find=Find" doc = Nokogiri::HTML(open(url)) @mattVar = doc.at_css("title").text end […]

Ruby奇怪的错误

每当我需要ruby或irb文件时,我都会收到此错误: LoadError: no such file to load — (insert any filename).rb from :29:in `require’ from :29:in `require’ from (irb):1 from /usr/bin/irb1.9.1:12:in `’ 它发生即使文件存在我使用ruby1.9.1据我所知,我还没有安装rubygems。 我在Ubuntu 10.10 Maverick Meerkat上运行。 请大家帮忙,这个问题很烦人! 在此先感谢,ell。 编辑:我忘了说,无论文件在哪里,即使它在同一目录中并且肯定存在,我总是得到这个错误。

如何将大型gem转换为独立的rails应用程序

我正在建立一个社交网络并且一直在使用gem community_engine但是在实现我的应用程序所需的大量自定义时遇到了麻烦。 我认为这将使我更容易覆盖和添加方法,并帮助我更好地理解和学习代码,因为我将能够实际看到所有这些在行动中。 到目前为止,在我的尝试中,我下载了源代码,添加了缺少的默认bin目录和配置文件,以及所有gem依赖项。 我还需要做些什么来让应用程序运行? 我意识到可能还有很多,而且可能不容易解释,但至少有没有任何类型的文档可以帮助我理解如何将gem转换为Rails应用程序? inheritance了community_engine回购: https : //github.com/bborn/communityengine 因为这个想法可能引起一些批评,我会补充说我最初构建的应用程序没有任何巨大的插件接受设计但是我没时间完成这个。 我尝试过的更多东西: 将文件移动到一个新的rails应用程序,让服务器运行,但遇到了许多看似随机的错误,修复了一些但更多似乎弹出我无法弄清楚: 我还看了http://guides.rubyonrails.org/plugins.html,但这个gem似乎超越了这一点。

gem install错误,索引未找到,ruby on rails

问题:无法安装任何类型的gem。 但是如果重要的话我想安装谜语。 当我运行sudo gem install “gem_name”我收到以下错误: WARNING: RubyGems 1.2+ index not found for: RubyGems will revert to legacy indexes degrading performance. Bulk updating Gem source index for: http://gems.rubyforge.org/ 该怎么办??

在ruby 2.0.0p247上安装ruby-debug-base时出错

我遇到了以下问题:如何为ruby安装调试器 C:\windows\system32>ruby -v ruby (2013-06-27) [i386-mingw32] C:\windows\system32>gem install ruby-debug-base Temporarily enhancing PATH to include DevKit… Building native extensions. This could take a while… ERROR: Error installing ruby-debug-base: ERROR: Failed to build gem native extension. C:/Ruby200/bin/ruby.exe extconf.rb Can’t handle 1.9.x yet *** extconf.rb failed *** Could not create Makefile due to some reason, probably lack of […]

Ruby on Rails,nginx,生产服务器上的乘客(无法加载此类文件 – ruby​​gems / path_support)

我安装了: Centos 6 Ruby 1.9.3-rc1 乘客gem和乘客nginx模块(根据自己的源1.1.6编译) 安装导轨3.1.0 Made / srv 铁路新测试了 捆绑安装 根据示例/ srv / test / public为nginx中的乘客制作了vhost service nginx stop && service nginx start ruby app加载好了index.html然后显示… 单击默认/public/index.html中的“检查应用程序环境”链接后,出现此错误 无法加载此类文件 – ruby​​gems / path_support Question: Anyone know how I can resolve the cannot load such file — rubygems/path_support error? Full error post below 无法启动Ruby(Rack)应用程序缺少应用程序所需的源文件。 您可能没有正确上传您的应用程序文件。 请检查是否上传了所有应用程序文件。 […]

open-uri不会将http重定向到https

我正在使用Hpricot和OpenURI来解析网页并从中提取url。 当我收到“http:rapidshare.com”这样的链接时,它不会重定向到https。 这是我得到的错误: /home/leonidus/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/open-uri.rb:216:in `open_loop’: redirection forbidden: http:……………..=> https:……………………. . . 我试图使用exception处理程序OPENURI::HTTPREDIRECT但我再次得到相同的错误。 我尝试了所有的博客,但它也没有得到解决。

Ruby soap4r wsdl2ruby.rb错误

我正在尝试运行soap4r gem附带的wsdl2ruby.rb脚本,并获得以下错误: [ral@lap etc]$ ruby /usr/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/bin/wsdl2ruby.rb /usr/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/charset.rb:13: warning: variable $KCODE is no longer effective /usr/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/property.rb:68: warning: encoding option is ignored – u /usr/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/property.rb:69: warning: encoding option is ignored – u /usr/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/property.rb:70: warning: encoding option is ignored – u /usr/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser.rb:74:in `’: XML processor module not found. (RuntimeError) from :29:in `require’ from :29:in `require’ from /usr/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/xmlSchema/parser.rb:13:in `’ […]