草庐IT

objc_requires_super

全部标签

ruby-on-rails - `require' : No such file to load -- test_helper (LoadError)

当我在生产模式下运行我的Rails应用程序时出现以下错误,但是当我在开发模式下运行我的应用程序时它工作正常。我可以在生产模式下使用任何Gem吗?`require':Nosuchfiletoload--test_helper(LoadError)以下是完整的代码轨迹:/home/nyros/.rvm/gems/ruby-2.2.0@dfl/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:229:in`require':Nosuchfiletoload--test_helper(LoadError)from/home/

ruby - `require` 与 `gem` 方法?

require和gem方法有什么区别?例如,require'minitest'和gem'minitest'有什么区别? 最佳答案 假设您安装了两个版本的gemfoo:$gemlistfoo***LOCALGEMS***foo(2.0.1,2.0.0)如果你只使用require,默认会加载最新版本:require'foo'#=>trueFoo::VERSION#=>"2.0.1"如果你在调用require之前使用了gem,你可以指定一个不同的版本来使用:gem'foo','2.0.0'#=>truerequire'foo'#=>tru

ruby-on-rails - rails : Omniauth - "The parameter app_id is required"

我正在按照这个railscast教程在我的rails项目上为facebook身份验证设置omniauth:http://railscasts.com/episodes/360-facebook-authentication?autoplay=true.我只用了4分钟,到目前为止我所做的就是捆绑gemomniauth-facebook并添加,omniauth.rbOmniAuth.config.logger=Rails.loggerRails.application.config.middleware.useOmniAuth::Builderdoprovider:facebook,ENV

ruby-on-rails - 什么时候需要在 Rails Gemfile 中使用 require?

在我的gemfile中我有这样的东西:gem'net-sftp','2.1.1',:require=>'net/sftp'gem'backup','3.0.27'gem'watu_table_builder',:require=>'table_builder'gem'browser','0.1.6'在Gemfile中什么时候需要require?我还发现了诸如:require=>false之类的东西。帮忙? 最佳答案 如果您省略:require选项,默认情况下Bundler将尝试使用标准名称到文件的转换规则来请求gem:dashesa

ruby - `require "ruby​​gems "` returning ` false` 可以吗?

要求“rubygems”给出false,但要求“appium_lib”给出true。即,require'rubygems'#=>falserequire'appium_lib'#=>true这样可以吗?这不像试图要求一些实际上不存在的东西,即:require'does_not_existxxxxxxx'#=>LoadError:cannotloadsuchfile--does_not_existxxxxxxx 最佳答案 应该没问题。第二次请求文件会导致错误响应。对于load,这是另一回事,它会在每次请求时load(require)文

nginx配置https后报错nginx: [emerg] https protocol requires SSL support in XXX.conf详细解决方法

一、前言最近,在测试环境的nginx里增加了一个https配置:location/api-meeting-qq/{proxy_passhttps://api.meeting.qq.com/;}然后,执行命令://这个是nginx启动文件的路径,根据实际情况自行更改sudo/home/useradmin/nginx/sbin/nginx-sreload结果,nginx就报错了:nginx:[emerg]httpsprotocolrequiresSSLsupportin/home/useradmin/nginx/conf.d/trainNginx.conf:9二、解决方法百度发现,是之前安装ngi

ruby - Require 返回一个数组而不是一个 bool 值

根据Kernel#require的文档该方法返回一个bool值。然而,我在IRBsession中注意到对于某些文件require返回一个数组。ruby-1.8.7-p330:001>require'net/http'=>trueruby-1.8.7-p330:002>require'date'=>trueruby-1.8.7-p330:003>require'lib/data_provider'=>["DataProviders"]返回的数组包含在data_provider.rb中定义的模块的名称:moduleDataProvidersmoduleCachedclassFoo#...e

ruby - super(&nil) 在 ruby​​ 中做什么?

我正在阅读thesourcecodeforconcurrent-ruby,并遇到了这行ruby​​代码。definitialize(*args,&block)super(&nil)#有人可以向我解释一下它应该做什么吗? 最佳答案 您必须首先了解此处使用的&运算符。参见示例:#The&hereconvertsablockargumenttoaprocdefa(&blk)end#The&hereconvertstheproctoablocka(&Proc.new{true})在proc=>block的情况下,它也可以将一些对象变成pro

ruby - 在 define_method 中调用 super 时没有父类(super class)方法

当我重写一个已经存在的方法时,为什么会出现以下错误talk:super:nosuperclassmethodtalk(NoMethodError)?如何修复此代码以调用super方法?这是我正在使用的示例代码classFoodeftalk(who,what,where)p"#{who}is#{what}at#{where}"endendFoo.new.talk("monster","jumping","home")classFoodefine_method(:talk)do|*params|super(*params)endendFoo.new.talk("monster","jump

ruby-on-rails - 葡萄 : required params with grape-entity

我正在用grape编写一个API服务器,我选择使用grape-entity因为它能够自动生成swagger的文档。但是现在我在按要求设置参数时遇到了问题。因为葡萄不验证参数是否存在。看起来grape忽略了实体参数的required:true。app.rbmoduleSmartmoduleVersion1classAppos_entity.rbmoduleSmartmoduleEntitiesclassOSEntityapp_entity.rbmoduleSmartmoduleEntitiesclassAppEntity现在其他一切都很好,但我不知道如何以DRY方式使用实体,并让grap