草庐IT

ERROR_NO_MATCH

全部标签

ruby-on-rails - "No such file or directory @ rb_sysopen"使用 OpenURI

我最近在使用OpenURI时遇到了问题。每个open方法都会导致以下错误:"Nosuchfileordirectory@rb_sysopen".我的代码如下所示:data=open("http://google.ca/")我在将gem'nokogiri'添加到我的Gemfile并运行bundleinstall后不久就注意到了这个错误,尽管我不知道是否或这不是导致问题的原因,并且此后删除了该条目,对问题没有任何积极影响。任何帮助将不胜感激。 最佳答案 尝试在你的代码前写上require'open-uri'。

ruby-on-rails - 运行 Rspec 时出现 "No such file to load"错误

MacOS10.4rspec(1.1.11,1.1.4,1.1.3,0.5.15)rspec-rails(1.1.11)rspec_generator(0.5.15)rails2.2.2ruby1.8.6(2007-03-13patchlevel0)[universal-darwin8.0]创建了一个新项目...$railsmyproject将rspec安装到项目中...$script/generaterspec生成资源...$script/generaterspec_scaffoldmyresourcename:stringdescription:text试图运行规范...$rake

ruby - 如何使 --no-ri --no-rdoc 成为 gem 安装的默认值?

这个问题在这里已经有了答案:关闭10年前。PossibleDuplicate:Howtomake--no-ri--no-rdocthedefaultforgeminstall?我从不使用ri或rdoc,它们的安装时间太长。有没有什么地方可以让我这样做的配置文件

ruby-on-rails - 在 Rails 3 中使用 current_page 时为 "No routes matches"

有没有人遇到过使用current_page时路由神秘地变得无法检测到?在Rails3中?即使使用包含路由、View和Controller的完全生成的脚手架,我也会收到“无路由匹配”错误。代码如下:ifcurrent_page?(:controller=>'users',:action=>"show")如果我向routes.rb添加一个“匹配”命令,它工作正常,但如果资源已经创建,为什么我需要这样做呢?我错过了什么? 最佳答案 如果你只是想测试当前的Controller,你可以这样做:ifparams[:controller]=='u

ruby-on-rails - Rails(set_no_cache 方法)无法在 Safari 和 Opera 中禁用浏览器缓存

在使用Devise进行身份验证后,我发现其中存在一个安全漏洞,在用户注销后,session变量会被保留。这允许任何人按下后退按钮并访问已登录用户的上一个屏幕。我看了这些帖子Num1Num2Num3我将这些行添加到我的application_controllerbefore_filter:set_no_cachedefset_no_cacheresponse.headers["Cache-Control"]="no-cache,no-store,max-age=0,must-revalidate"response.headers["Pragma"]="no-cache"response.

ruby-on-rails - 验证失败 : Upload file has an extension that does not match its contents

我正在使用回形针gem上传文件。我的回形针gem版本是paperclip-4.1.1。上传文件时抛出Validationfailed:Uploadfilehasanextensionthatdoesnotmatchitscontents.我正在尝试上传xlsx文件。而且我已经在模型content_type中提到了这一点。validates_attachment_content_type:upload_file,:content_type=>%w(application/mswordapplication/vnd.ms-officeapplication/vnd.ms-excelappl

ruby-on-rails - 在 Rails 3.2 中使用 "error_messages"? (引发 "undefined method"错误)

我在Rails3.2功能测试中遇到以下错误:ActionView::Template::Error:undefinedmethod`error_messages'for#产生错误的View代码:#problematiccode这是我的Controller中调用上述View代码的代码:render:action=>"edit",:status=>:bad_request这是我正在运行的测试:test"updateaprogramwithabadrequest"doput:update,:id=>programs(:traditional).to_param,:program=>{:min

ruby-on-rails - rails 4 : Error when installing tiny_tds gem?

我使用Rubyv2和Railsv4开发了一个RailsWeb项目。它在我当前的系统中运行良好,当我尝试在另一台Linux机器(Ubuntu12.4)中运行该项目时,出现Tidy_tds错误。此错误在bundleinstall时显示,错误详情如下Gem::Ext::BuildError:ERROR:Failedtobuildgemnativeextension./home/action/.rvm/rubies/ruby-2.1.1/bin/rubyextconf.rbcheckingforiconv_open()iniconv.h...yescheckingforsybfront.h..

ruby-on-rails - ruby rails : no such file to load -- openssl on RedHat Linux Enterprise

我正在尝试执行“rakedb:migrate”并收到错误消息“没有要加载的文件--openssl”。“openssl”和“openssl-devel”包都已安装。Debian或Ubuntu上的其他人似乎能够通过安装“libopenssl-ruby”来摆脱这种情况,这不适用于RedHat。有没有人遇到过这个问题并有解决方案? 最佳答案 升级到8.10后,我在Ubuntu上遇到了这个问题。Ubuntu的解决方案是sudoapt-get安装libopenssl-ruby 关于ruby-on-r

ruby - rbenv 和 bundler : "bad interpreter: No such file or directory"

我搞砸了我的配置。我正在运行Ubuntu14.04,当我尝试从一个项目转移到另一个项目时遇到了一些问题。我尝试卸载并重新安装rbenv,然后按照本指南安装了Ruby2.1.7:https://gorails.com/setup/ubuntu/14.04.现在,当我运行geminstallbundler时,没有任何反应,我无法安装任何gem。当我输入bundler或bundler-v我看到这个:/usr/local/bin/bundler:/usr/bin/ruby1.9.1:badinterpreter:Nosuchfileordirectory我花了很多时间试图解决这个问题,但我真的