jjzjj

CONFIGURE

全部标签

ruby-on-rails - 测试我的 Ruby gem:Shoulda::Matchers:Module (NoMethodError) 的未定义方法 `configure'

我正在开发我的第一个Rubygem,并捆绑了cucumber、rspec和shoulda-matches进行测试。当我运行rspec时,出现以下错误:/app/my_gem/spec/spec_helper.rb:6:in`':undefinedmethod`configure'forShoulda::Matchers:Module(NoMethodError)这是我的gem规范:#my_gem.gemspec...Gem::Specification.newdo|spec|......spec.add_development_dependency"activemodel"spec.a

ruby-on-rails - rails 生成 rspec :install config/environments/development. rb:1:in `<top (required)>': 未定义方法 `configure'

首先,这是我的版本:Greg-Nowickis-MacBook-Pro:sample_appGreg_Nowicki$ruby-vruby2.0.0p451(2014-02-24revision45167)[x86_64-darwin13.1.0]Greg-Nowickis-MacBook-Pro:sample_appGreg_Nowicki$rails-vRails4.0.4我正在学习HartlRails教程并安装rspec进行测试。我已将gem'rspec-rails'添加到我的gemfile中,当我运行railsgeneraterspec:install时,这就是我得到的:Gre

ruby - 检查是否调用了类方法

我有以下模块和类:moduleMyModuledefself.includedbasebase.extend(ClassMethods)endmoduleClassMethodsattr_reader:config#thismethodMUSTbecalledbyeveryclasswhichincludesMyModuledefconfigure&block@config={}block.call(@config)ifblockendendendclassAincludeMyModuleconfiguredo|config|#dosthwiththeconfigendendclass

ruby-on-rails - RSpec.configure 和请求对象

我有一个作为RESTfulAPI构建的Rails3.1应用程序。计划是根据通过AuthorizationHTTPheader在每个请求上传递的APIkey来处理身份验证。为了在RSpec中对此进行测试,我想在config.beforeblock中设置request.env["HTTP_AUTHORIZATION"]属性:RSpec.configuredo|config|config.mock_with:rspecconfig.use_transactional_fixtures=trueconfig.before(:each)do#SetAPIkeyinAuthorizationhea

ruby - 安装 Ruby rvm 时出现问题(运行配置时出错)

关闭。这个问题是off-topic.它目前不接受答案。想改进这个问题吗?Updatethequestion所以它是on-topic用于堆栈溢出。关闭11年前。Improvethisquestionruby-1.9.3-p0-#configuring*ERROR:Errorrunning'./configure--prefix=/Users/davedelich/.rvm/rubies/ruby-1.9.3-p0--enable-shared--disable-install-doc--with-libyaml-dir=/Users/davedelich/.rvm/usr',please

ruby - Savon :Module 的未定义方法 `configure'

我在使用此代码片段的gem中遇到上述错误Savon.configuredo|config|config.log=falseconfig.log_level=:errorHTTPI.log=falseend这段代码过去曾在Travis上运行过,所以我不确定为什么在我更改自述文件时会发生变化。 最佳答案 这种困惑的部分原因是我的情况——继承要维护的gem——以及gemspec中的这一行:gem.add_dependency'savon'没有versionnumberspecified,所以最新的运行切换到使用Savon2,它放弃了Sav

ruby - 在 Mountain Lion 上安装 Ruby 时出现问题 - ruby​​ 1.9.3 不会编译

我之前看过很多关于此的帖子,并按照他们的说明进行操作,但没有任何效果。我将在下面概述我所做的事情,以及我所遵循的说明-如果您有任何建议,我将不胜感激!我遵循了以下安装说明:http://pragmaticstudio.com/blog/2010/9/23/install-rails-ruby-mac我已经为OSXMountainLion下载了X代码,并安装了gcc编译器:$gcc--versioni686-apple-darwin11-llvm-gcc-4.2(GCC)4.2.1(BasedonAppleInc.build5658)(LLVMbuild2336.11.00)Copyri

ruby - 在 RSpec 中自动共享上下文

我想在我的规范之间共享一个内存方法。所以我尝试像这样使用共享上下文RSpec.configuredo|spec|spec.shared_context:specsdolet(:response){request.execute!}endenddescribe'something'doinclude_context:specsend它工作正常。但是我有大约60个规范文件,所以我不得不在每个文件中明确包含上下文。有没有办法为spec_helper.rb中的所有示例组自动包含共享上下文(或至少let定义)?像这样RSpec.configuredo|spec|spec.include_cont

ruby - sinatra config.ru : what is the configure block for?

我将Sinatra与Apache和“经典”风格的Phusion-Passenger一起使用:#config.rurequire'sinatra'configuredo....endrequire'./app'runSinatra::Application我想定义一些东西。在配置block内部或外部定义它有什么区别?#config.rurequire'sinatra'#A)Definingloggerhererack=File.new("logs/rack.log","a+")useRack::CommonLogger,rack#B)GlobalvariableshereLOGGER=L

ruby - Xcode - 配置 : error: no acceptable C compiler found in $PATH

从头开始重建Mac。安装xcode和rvm然后尝试安装ruby但他们都给我:Errorrunning'./configure--prefix=/Users/durrantm/.rvm/rubies/ruby-1.9.3-p125--enable-shared--disable-install-doc--with-libyaml--with-opt-dir=/Users/durrantm/.rvm/usr',pleaseread/Users/durrantm/.rvm/log/ruby-1.9.3-p125/configure.logTherehasbeenanerrorwhilerun