- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有一个在 Rails 4/Ruby 2 上运行的应用程序。前端正在用 Ember 开发。
运行时 rake spec
,我收到以下异常。它似乎只发生在 Rspec 功能规范中(不在开发模式下)。此外,通常只有当我只运行一个功能规范时才会发生这种情况;如果我运行整个测试套件,我通常不会收到错误消息。
由于此对 Rails 的提交,发生错误:
https://github.com/rails/rails/commit/b33700f5580b4cd85379a1dc60fa341ac4d8deb2
但是,当然,我不知道这是真正的问题还是调用堆栈中更深层次的问题。我确实知道,如果我对 Rails 代码进行最小的更改以不引发该错误,那么一切似乎都可以正常工作并且我的测试通过。但是,某处似乎正在尝试加载 LocationsController,即使它已经加载。
非常感谢任何帮助,因为这个让我真的很难过。
1) Locations Creating locations
Failure/Error: Unable to find matching line from backtrace
RuntimeError:
Circular dependency detected while autoloading constant LocationsController
# /usr/local/rvm/gems/ruby-2.0.0-p195@nepco/bundler/gems/rails-783c6711a4b4/activesupport/lib/active_support/dependencies.rb:460:in `load_missing_constant'
# /usr/local/rvm/gems/ruby-2.0.0-p195@nepco/bundler/gems/rails-783c6711a4b4/activesupport/lib/active_support/dependencies.rb:183:in `const_missing'
# /usr/local/rvm/gems/ruby-2.0.0-p195@nepco/bundler/gems/rails-783c6711a4b4/activesupport/lib/active_support/inflector/methods.rb:226:in `const_get'
# /usr/local/rvm/gems/ruby-2.0.0-p195@nepco/bundler/gems/rails-783c6711a4b4/activesupport/lib/active_support/inflector/methods.rb:226:in `block in constantize'
# /usr/local/rvm/gems/ruby-2.0.0-p195@nepco/bundler/gems/rails-783c6711a4b4/activesupport/lib/active_support/inflector/methods.rb:224:in `each'
# /usr/local/rvm/gems/ruby-2.0.0-p195@nepco/bundler/gems/rails-783c6711a4b4/activesupport/lib/active_support/inflector/methods.rb:224:in `inject'
# /usr/local/rvm/gems/ruby-2.0.0-p195@nepco/bundler/gems/rails-783c6711a4b4/activesupport/lib/active_support/inflector/methods.rb:224:in `constantize'
# /usr/local/rvm/gems/ruby-2.0.0-p195@nepco/bundler/gems/rails-783c6711a4b4/activesupport/lib/active_support/dependencies.rb:534:in `get'
# /usr/local/rvm/gems/ruby-2.0.0-p195@nepco/bundler/gems/rails-783c6711a4b4/activesupport/lib/active_support/dependencies.rb:565:in `constantize'
# /usr/local/rvm/gems/ruby-2.0.0-p195@nepco/bundler/gems/rails-783c6711a4b4/actionpack/lib/action_dispatch/routing/route_set.rb:76:in `controller_reference'
# /usr/local/rvm/gems/ruby-2.0.0-p195@nepco/bundler/gems/rails-783c6711a4b4/actionpack/lib/action_dispatch/routing/route_set.rb:66:in `controller'
# /usr/local/rvm/gems/ruby-2.0.0-p195@nepco/bundler/gems/rails-783c6711a4b4/actionpack/lib/action_dispatch/routing/route_set.rb:44:in `call'
# /usr/local/rvm/gems/ruby-2.0.0-p195@nepco/bundler/gems/rails-783c6711a4b4/actionpack/lib/action_dispatch/journey/router.rb:71:in `block in call'
# /usr/local/rvm/gems/ruby-2.0.0-p195@nepco/bundler/gems/rails-783c6711a4b4/actionpack/lib/action_dispatch/journey/router.rb:59:in `each'
# /usr/local/rvm/gems/ruby-2.0.0-p195@nepco/bundler/gems/rails-783c6711a4b4/actionpack/lib/action_dispatch/journey/router.rb:59:in `call'
# /usr/local/rvm/gems/ruby-2.0.0-p195@nepco/bundler/gems/rails-783c6711a4b4/actionpack/lib/action_dispatch/routing/route_set.rb:655:in `call'
# /usr/local/rvm/gems/ruby-2.0.0-p195@nepco/gems/request_store-1.0.5/lib/request_store/middleware.rb:9:in `call'
# /usr/local/rvm/gems/ruby-2.0.0-p195@nepco/gems/warden-1.2.1/lib/warden/manager.rb:35:in `block in call'
# /usr/local/rvm/gems/ruby-2.0.0-p195@nepco/gems/warden-1.2.1/lib/warden/manager.rb:34:in `catch'
# /usr/local/rvm/gems/ruby-2.0.0-p195@nepco/gems/warden-1.2.1/lib/warden/manager.rb:34:in `call'
# /usr/local/rvm/gems/ruby-2.0.0-p195@nepco/gems/rack-1.5.2/lib/rack/etag.rb:23:in `call'
# /usr/local/rvm/gems/ruby-2.0.0-p195@nepco/gems/rack-1.5.2/lib/rack/conditionalget.rb:25:in `call'
# /usr/local/rvm/gems/ruby-2.0.0-p195@nepco/gems/rack-1.5.2/lib/rack/head.rb:11:in `call'
# /usr/local/rvm/gems/ruby-2.0.0-p195@nepco/bundler/gems/rails-783c6711a4b4/actionpack/lib/action_dispatch/middleware/params_parser.rb:27:in `call'
# /usr/local/rvm/gems/ruby-2.0.0-p195@nepco/bundler/gems/rails-783c6711a4b4/actionpack/lib/action_dispatch/middleware/flash.rb:241:in `call'
# /usr/local/rvm/gems/ruby-2.0.0-p195@nepco/gems/rack-1.5.2/lib/rack/session/abstract/id.rb:225:in `context'
# /usr/local/rvm/gems/ruby-2.0.0-p195@nepco/gems/rack-1.5.2/lib/rack/session/abstract/id.rb:220:in `call'
# /usr/local/rvm/gems/ruby-2.0.0-p195@nepco/bundler/gems/rails-783c6711a4b4/actionpack/lib/action_dispatch/middleware/cookies.rb:486:in `call'
# /usr/local/rvm/gems/ruby-2.0.0-p195@nepco/bundler/gems/rails-783c6711a4b4/activerecord/lib/active_record/query_cache.rb:36:in `call'
# /usr/local/rvm/gems/ruby-2.0.0-p195@nepco/bundler/gems/rails-783c6711a4b4/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:626:in `call'
# /usr/local/rvm/gems/ruby-2.0.0-p195@nepco/bundler/gems/rails-783c6711a4b4/actionpack/lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
# /usr/local/rvm/gems/ruby-2.0.0-p195@nepco/bundler/gems/rails-783c6711a4b4/activesupport/lib/active_support/callbacks.rb:373:in `_run__1828229838678430325__call__callbacks'
# /usr/local/rvm/gems/ruby-2.0.0-p195@nepco/bundler/gems/rails-783c6711a4b4/activesupport/lib/active_support/callbacks.rb:80:in `run_callbacks'
# /usr/local/rvm/gems/ruby-2.0.0-p195@nepco/bundler/gems/rails-783c6711a4b4/actionpack/lib/action_dispatch/middleware/callbacks.rb:27:in `call'
# /usr/local/rvm/gems/ruby-2.0.0-p195@nepco/bundler/gems/rails-783c6711a4b4/actionpack/lib/action_dispatch/middleware/remote_ip.rb:76:in `call'
# /usr/local/rvm/gems/ruby-2.0.0-p195@nepco/bundler/gems/rails-783c6711a4b4/actionpack/lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
# /usr/local/rvm/gems/ruby-2.0.0-p195@nepco/bundler/gems/rails-783c6711a4b4/actionpack/lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
# /usr/local/rvm/gems/ruby-2.0.0-p195@nepco/bundler/gems/rails-783c6711a4b4/railties/lib/rails/rack/logger.rb:38:in `call_app'
# /usr/local/rvm/gems/ruby-2.0.0-p195@nepco/bundler/gems/rails-783c6711a4b4/railties/lib/rails/rack/logger.rb:21:in `block in call'
# /usr/local/rvm/gems/ruby-2.0.0-p195@nepco/bundler/gems/rails-783c6711a4b4/activesupport/lib/active_support/tagged_logging.rb:67:in `block in tagged'
# /usr/local/rvm/gems/ruby-2.0.0-p195@nepco/bundler/gems/rails-783c6711a4b4/activesupport/lib/active_support/tagged_logging.rb:25:in `tagged'
# /usr/local/rvm/gems/ruby-2.0.0-p195@nepco/bundler/gems/rails-783c6711a4b4/activesupport/lib/active_support/tagged_logging.rb:67:in `tagged'
# /usr/local/rvm/gems/ruby-2.0.0-p195@nepco/bundler/gems/rails-783c6711a4b4/railties/lib/rails/rack/logger.rb:21:in `call'
# /usr/local/rvm/gems/ruby-2.0.0-p195@nepco/gems/quiet_assets-1.0.2/lib/quiet_assets.rb:18:in `call_with_quiet_assets'
# /usr/local/rvm/gems/ruby-2.0.0-p195@nepco/bundler/gems/rails-783c6711a4b4/actionpack/lib/action_dispatch/middleware/request_id.rb:21:in `call'
# /usr/local/rvm/gems/ruby-2.0.0-p195@nepco/gems/rack-1.5.2/lib/rack/methodoverride.rb:21:in `call'
# /usr/local/rvm/gems/ruby-2.0.0-p195@nepco/gems/rack-1.5.2/lib/rack/runtime.rb:17:in `call'
# /usr/local/rvm/gems/ruby-2.0.0-p195@nepco/bundler/gems/rails-783c6711a4b4/activesupport/lib/active_support/cache/strategy/local_cache.rb:83:in `call'
# /usr/local/rvm/gems/ruby-2.0.0-p195@nepco/bundler/gems/rails-783c6711a4b4/actionpack/lib/action_dispatch/middleware/static.rb:64:in `call'
# /usr/local/rvm/gems/ruby-2.0.0-p195@nepco/bundler/gems/rails-783c6711a4b4/railties/lib/rails/engine.rb:511:in `call'
# /usr/local/rvm/gems/ruby-2.0.0-p195@nepco/bundler/gems/rails-783c6711a4b4/railties/lib/rails/application.rb:97:in `call'
# /usr/local/rvm/gems/ruby-2.0.0-p195@nepco/gems/rack-1.5.2/lib/rack/builder.rb:138:in `call'
# /usr/local/rvm/gems/ruby-2.0.0-p195@nepco/gems/rack-1.5.2/lib/rack/urlmap.rb:65:in `block in call'
# /usr/local/rvm/gems/ruby-2.0.0-p195@nepco/gems/rack-1.5.2/lib/rack/urlmap.rb:50:in `each'
# /usr/local/rvm/gems/ruby-2.0.0-p195@nepco/gems/rack-1.5.2/lib/rack/urlmap.rb:50:in `call'
# /usr/local/rvm/gems/ruby-2.0.0-p195@nepco/gems/capybara-2.1.0/lib/capybara/server.rb:19:in `call'
# /usr/local/rvm/gems/ruby-2.0.0-p195@nepco/gems/rack-1.5.2/lib/rack/handler/webrick.rb:60:in `service'
# /usr/local/rvm/rubies/ruby-2.0.0-p195/lib/ruby/2.0.0/webrick/httpserver.rb:138:in `service'
# /usr/local/rvm/rubies/ruby-2.0.0-p195/lib/ruby/2.0.0/webrick/httpserver.rb:94:in `run'
# /usr/local/rvm/rubies/ruby-2.0.0-p195/lib/ruby/2.0.0/webrick/server.rb:295:in `block in start_thread'
get '/locations', to: 'main#index', :as => :em_locations
scope 'api' do
resources :locations, only: [:index]
end
* capybara (2.1.0)
* rspec (2.13.0)
* rspec-core (2.13.1)
* rspec-expectations (2.13.0)
* rspec-mocks (2.13.1)
* rspec-rails (2.13.2)
* ember-data-source (0.0.5)
* ember-rails (0.12.0)
* ember-source (1.0.0.rc3.3)
* active_model_serializers (0.8.1)
require 'spec_helper'
feature 'Locations', js: true, strategy: :truncation, slow: true do
before do
login_for_request
Factory.create(:warehouse, code: "TW", name: 'TEST WAREHOUSE')
end
scenario "Creating locations" do
visit em_locations_path
click_link "create-locations"
select 'TEST WAREHOUSE', from: "warehouse"
select "GLD", from: "section"
fill_in "row-start", with: "AA"
fill_in "row-end", with: "AB"
fill_in "bay-start", with: "1"
fill_in "bay-end", with: "2"
fill_in "tier-start", with: "1"
fill_in "tier-end", with: "2"
fill_in "subbay-start", with: "1"
fill_in "subbay-end", with: "2"
click_button "Create"
end
end
最佳答案
我想出了一个可能的解决方案来解决这个问题。这可能不是最好的方法,我认为没有必要,但它仍然有效并且始终如一。
在我的功能规范中,我需要相关的 Controller :
require_relative '../../app/controllers/locations_controller'
require_relative '../serializers/location_serializer'
关于ruby-on-rails - Rspec 请求规范期间 Rails 4 中的循环依赖错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16820158/
我在 gobject 上阅读了一个维基百科页面,上面写着, Depending only on GLib and libc, GObject is a cornerstone of GNOME and
如何注册一个依赖属性,其值是使用另一个依赖属性的值计算的? 由于 .NET 属性包装器在运行时被 WPF 绕过,因此不应在 getter 和 setter 中包含逻辑。解决方案通常是使用 Proper
我一直在尝试将 ActionbarSherlock maven 依赖项添加到我的项目中 com.actionbarsherlock library 4.2.0 在我的 po
http://tutorials.jenkov.com/ood/understanding-dependencies.html#whatis说(强调我的): Whenever a class A us
我对所有这些魔法有点不清楚。 据我了解,依赖属性是从 DependencyObject 继承的,因此存储值: 如果分配了值(在本地字典中),则在实例本身中 或者如果未指定值,则从指向父元素的链接中获取
我刚刚更新了在 ASP.NET Framework 4.5.2 版上运行的 MVC Web 应用程序。我正在使用 Twilio 发送 SMS 消息: var twilio = new TwilioRe
我刚刚发现了一件令人生畏的事情。 spring 依赖坐标有两个版本。 项目依赖于 spring mvc 和 spring flow。有两组并行的依赖项。 Spring MVC 具有以下方案的依赖项
我正在尝试包含 的 maven 依赖项 org.jacorb jacorb 2.3.1 依赖已解决,但它导致另一个依赖 picocontainer 出现问题: [ERROR
我正在尝试在 Haskell 项目中包含特定版本的库。该库是住宿加早餐型的(用于 martix 操作),但我需要特定的 0.4.3 版本,该版本修复了乘法实现的错误。 所以,我的 stack.yaml
有谁知道如何制作依赖的 UIPickerView.例如,当我选择组件一的第 2 行时,组件二的标题会发生变化吗? 我在互联网上查找过,没有真正的答案,我尝试过使用 if 和 switch 语句,但它们
我正在编写一个用于验收测试的项目,由于各种原因,这依赖于另一个打包为 WAR 的项目。我已成功使用 maven-dependency-plugin 解压 WAR,但无法让我的项目包含解压的 WEB-I
或多或少我在 session 上大量构建我的网站(特别是重定向用户等),我很好奇这是否是一种危险的做法。禁用浏览器 cookie 保存的用户的大致比例是多少?我愿意接受任何建议:) 谢谢 最佳答案 s
开始玩 Scala futures,我被依赖的 futures 困住了。 让我们举个例子。我搜索地点并获得 Future[Seq[Place]]。对于这些地点中的每一个,我搜索最近的地铁站(该服务返回
或多或少我在 session 上大量构建我的网站(特别是重定向用户等),我很好奇这是否是一种危险的做法。禁用浏览器 cookie 保存的用户的大致比例是多少?我愿意接受任何建议:) 谢谢 最佳答案 s
我有一个二进制文件,需要一些 *.so 文件才能执行。现在,当我尝试在一些旧机器上执行它时,它会显示 /lib/libc.so.6: version `GLIBC_2.4' not found 如何将
我尝试使用 Dygraph 来表示图表,我在 https://github.com/danvk/dygraphs 中找到了代码,但是它有太多的依赖文件,我觉得很烦人。是否有一个文件可以容纳所有必需的
我正在处理一个 javascript 文件,该文件 a) 声明一个具有函数的对象,并且 b) 使用它期望在外部声明的散列调用该对象的 init 函数。我的 Jasmine 规范提示它找不到哈希,因为它
最近我一直在学习 Angular 并且进展顺利,但是关于依赖注入(inject)的一些事情我仍然不清楚。 是否有任何理由在我的 app.js 文件中声明我的应用程序的其他部分(服务、 Controll
考虑一个名为 foo 的表,它有 id (PRIMARY & AUTO_INCREMENT) 列。我正在向该表中插入一行,挑战从此时开始。 $db->query("INSERT INTO `foo`
我正在使用级联下拉 jquery 插件。 (https://github.com/dnasir/jquery-cascading-dropdown) 我有两个下拉菜单。 “客户端”和“站点”。 根据您
我是一名优秀的程序员,十分优秀!