在 RubyMine 中运行规范会导致“无法加载此类文件 -- teamcity/spec/runner/formatter/teamcity/formatter (LoadError)"; [英] Running a spec in RubyMine results in "cannot load such file -- teamcity/spec/runner/formatter/teamcity/formatter (LoadError)"

查看:41
本文介绍了在 RubyMine 中运行规范会导致“无法加载此类文件 -- teamcity/spec/runner/formatter/teamcity/formatter (LoadError)";的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

操作系统:Arch Linux,Rails 版本:4,RubyMine:6.3

OS: Arch Linux, Rails version: 4, RubyMine: 6.3

当我从 Tools - Run Rake Task - spec 运行规范时,我总是收到此错误:

When I run a spec from Tools - Run Rake Task - spec I always get this error:

/home/chylli/.rvm/gems/ruby-2.1.2@rails4/gems/rspec-core-3.0.2/lib/rspec/core/configuration.rb:1024:in `require': 无法加载这样的文件 -- teamcity/spec/runner/formatter/teamcity/formatter (LoadError)

/home/chylli/.rvm/gems/ruby-2.1.2@rails4/gems/rspec-core-3.0.2/lib/rspec/core/configuration.rb:1024:in `require': cannot load such file -- teamcity/spec/runner/formatter/teamcity/formatter (LoadError)

但是可以运行debug spec:models".

but it is OK to run 'debug spec:models'.

我尝试过的:我在运行下添加了ruby arguments" - 编辑配置:

What I tried: I added 'ruby arguments' under Run - edit configurations:

-I$RUBYMINE_HOME/rb/testing/patch/bdd -I$RUBYMINE_HOME/rb/testing/patch/common

-I$RUBYMINE_HOME/rb/testing/patch/bdd -I$RUBYMINE_HOME/rb/testing/patch/common

但它不起作用.

推荐答案

运行

spring stop

在从 RubyMine 运行 rake 之前在命令行上,或者直接运行规范,或者做任何其他使用 spring 的事情.

on the command line before running rake from RubyMine, or running specs directly, or doing anything else that uses spring.

您不需要在每次在 RubyMine 中运行 rake 或 specs 或其他任何东西时都执行此操作,前提是您之前通过运行 rake 或执行其他在 RubyMine 之外启动 spring 的操作来启动 spring.当您从 RubyMine 切换回命令行时,您也不需要 spring stop.

You don't need to do this every time you run rake or specs or whatever in RubyMine, only if you previously started spring by running rake or doing something else that starts spring outside of RubyMine. You also don't need to spring stop when you switch from RubyMine back to the command line.

发生这种情况是因为如果在您运行 rake 或 RubyMine 之外的任何东西时 spring 没有运行,spring 将启动并预加载您的代码,但不会预加载 RubyMine 特定的代码.显然spring启动后不知道如何加载丢失的代码.

This happens because if spring is not running when you run rake or whatever outside RubyMine, spring will start and will preload your code but not RubyMine-specific code. Evidently spring doesn't know how to load missing code after it's been started.

这篇关于在 RubyMine 中运行规范会导致“无法加载此类文件 -- teamcity/spec/runner/formatter/teamcity/formatter (LoadError)";的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆