草庐IT

assertion_failed

全部标签

ruby - 错误 : Failed to build gem native extension (ruby extconf. rb): Mac OSX

这个问题在这里已经有了答案:RubyGeminstallJsonfailsonMavericksandXcode5.1-unknownargument:'-multiply_definedsuppress'(11个答案)关闭7年前。我正在尝试安装一个gem,但出现了这个错误,这是我自己和gem作者以前从未见过的。我该如何解决这个问题?Davids-MacBook-Pro:webdavid$sudo/usr/bin/geminstallcompass--prePassword:Buildingnativeextensions.Thiscouldtakeawhile...ERROR:Err

ruby-on-rails - Capistrano 无法部署代码,因为 Net::SSH::AuthenticationFailed: Authentication failed

我们有一个在AmazonAWS上运行的Rails应用程序。连续几个月,我们几乎每天都向那里推送新代码。今天,当我试图在那里部署一个新代码时,我得到了这个错误信息:*2014-02-1613:09:51executing`deploy'*2014-02-1613:09:51executing`deploy:update'**transaction:start*2014-02-1613:09:51executing`deploy:update_code'updatingthecachedcheckoutonallserversexecutinglocally:"gitls-remotegi

ruby - 运行 make install 时出现 RVM 错误。安装 power_assert gem 时出错

我正在尝试在我的arch机器上安装ruby​​2.2.2。当我运行rvminstall时,出现以下错误。试了几次。甚至删除了rvm并重新安装。还是一样的问题。○rvminstall2.2.2Searchingforbinaryrubies,thismighttakesometime.Nobinaryrubiesavailablefor:arch/libc-2.21/x86_64/ruby-2.2.2.Continuingwithcompilation.Pleaseread'rvmhelpmount'togetmoreinformationonbinaryrubies.Checkingr

ruby - 为什么 assert_equal 哈希的格式/语法与其他 assert_equals 不同?

我正在研究RubyKoans目前正在使用AboutHashes。到目前为止,assert_equals遵循特定的格式样式:assert_equalspaceexpected_valuecommaactualvalue(例如,assert_equal2,1+1)。但是AboutHashes中的test_creating_hashesdef有一个不遵循这种模式的assert_equal,如果我更改它以匹配该模式,它就会失败。具体来说:deftest_creating_hashesempty_hash=Hash.newassert_equal{},empty_hash#-->failsass

ruby-on-rails - 如何只测试重定向到的 URL 的一部分(使用 assert_redirected_to)?

在我的Rails应用程序的功能测试中,我想测试我被重定向到的位置。预期的URL指向外部资源(这意味着它不是我的应用程序的一部分)。URL如下所示:https://my.url.com/foo?bar1=xyz&bar2=123不幸的是我无法预测参数,因为它们是由外部资源生成的。*但是,URL的其余部分始终保持不变:https://my.url.com/foo我通常使用assert_redirected_to进行此类测试,但这需要整个URL,包括参数。谁能想出另一种方法来测试该重定向,但只检查没有参数的URL的第一部分?(该URL不在assigns哈希中)*(我对应用程序进行API调用,

ruby-on-rails - bundle 安装 : ERROR: Failed to build gem native extension. nio4r gem

我目前正在使用以下项目进行项目:rvm1.26.11ruby2.2.1p85我尝试运行bundleinstall但不断收到以下错误:Gem::Ext::BuildError:ERROR:Failedtobuildgemnativeextension.并且,以下:Anerroroccurredwhileinstallingnio4r(1.0.0),andBundlercannotcontinue.Makesurethat`geminstallnio4r-v'1.0.0'`succeedsbeforebundling.当我尝试运行geminstallnio4r-v'1.0.0'时:Buil

ruby - 错误 : Error installing ffi: ERROR: Failed to build gem native extension

安装了DevKit并重新运行ffi安装…。将其作为输出:C:\DocumentsandSettings\******>geminstallffiTemporarilyenhancingPATHtoincludeDevKit...Buildingnativeextensions.Thiscouldtakeawhile...ERROR:Errorinstallingffi:ERROR:Failedtobuildgemnativeextension.C:/Ruby192/bin/ruby.exeextconf.rbcheckingforffi.h...nocheckingforffi.hin

ruby-on-rails - "Certificate verify failed"使用 Ruby 1.9.3 时出现 OpenSSL 错误

我在MacOS10.6.8(使用rvm安装)上使用Ruby1.9.3p0。当我尝试使用applicationtemplatehostedonGitHub创建一个新的Rails应用程序时,用这个(例如):$railsnewmyapp-mhttps://github.com/RailsApps/rails3-application-templates/raw/master/rails3-mongoid-devise-template.rb-T-O我收到此错误消息:/Users/me/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/net/http.rb:7

ruby-on-rails - rails : comparison of Status with Status failed

我需要获取所有current_user.friends状态,然后按created_at对它们进行排序。classUser在Controller中:defindex@statuses=[]current_user.friends.map{|friend|friend.statuses.each{|status|@statusesa.created_at}endcurrent_user.friends返回对象数组Userfriend.statuses返回对象数组Status错误:comparisonofStatuswithStatusfailedapp/controllers/welcom

ruby-on-rails - Rails - 如何将变量插入正则表达式 (Regex),例如 assert_match

我想做类似的事情assert_match/blahblahblah#{@user}/,@some_text但我运气不好。我在这里做错了什么? 最佳答案 这是将变量插入正则表达式的正确方法:irb(main):001:0>a='Hi'=>"Hi"irb(main):002:0>b=/Not#{a}/=>/NotHi/所以您的问题很可能是断言由于匹配不当而失败。检查@user和@some_text的值并尝试http://rubular.com想出一个匹配的正则表达式 关于ruby-on-ra