首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使用Spork和Guard时启动时出错

使用Spork和Guard时启动时出错
EN

Stack Overflow用户
提问于 2013-01-30 03:08:32
回答 3查看 4.1K关注 0票数 18

问题就在这里。当我调用Guard时,添加Guard gem时一切正常。当我添加Spork时,我得到以下错误,它不会影响我的测试,但每次我尝试重新启动Guard时它都会出现。

代码语言:javascript
复制
19:01:28 - INFO - Guard uses TerminalTitle to send notifications.
19:01:28 - INFO - Starting Spork for RSpec
19:01:28 - ERROR - Guard::Spork failed to achieve its <start>, exception was:

#5232DAD6505A /Users/periclestheodorou/.rvm/gems/ruby-1.9.3-p362/gems/guard-spork-1.2.0/lib/guard/spork/spork_进程::启动错误:没有这样的文件或目录-捆绑包exec spork -p 8989 #5232DAD6505A /Users/periclestheodorou/.rvm/gems/ruby-1.9.3-p362/gems/guard-spork-1.2.0/lib/guard/spork/spork_ launch_process' [#5232DAD6505A] /Users/periclestheodorou/.rvm/gems/ruby-1.9.3-p362/gems/childprocess-0.3.7/lib/childprocess/abstract_process.rb:68:instart‘#5232DAD6505A instance.rb:38:in start' [#5232DAD6505A] /Users/periclestheodorou/.rvm/gems/ruby-1.9.3-p362/gems/guard-spork-1.2.0/lib/guard/spork/runner.rb:33:ineach‘#5232DAD6505A /Users/periclestheodorou/.rvm/gems/ruby-1.9.3-p362/gems/guard-spork-1.2.0/lib/guard/spork/runner.rb:33:in launch_sporks' [#5232DAD6505A] /Users/periclestheodorou/.rvm/gems/ruby-1.9.3-p362/gems/guard-spork-1.2.0/lib/guard/spork.rb:21:instart’#5232DAD6505A instance.rb:38:instart' [#5232DAD6505A] /Users/periclestheodorou/.rvm/gems/ruby-1.9.3-p362/gems/guard-spork-1.2.0/lib/guard/spork/runner.rb:33:inlaunch_sporks' [#5232DAD6505A] /Users/periclestheodorou/.rvm/gems/ruby-1.9.3-p362/gems/guard-spork-1.2.0/lib/guard/spork.rb:21:in‘#5232DAD6505A /Users/run‘#5232DAD6505A periclestheodorou/.rvm/gems/ruby-1.9.3-p362/gems/guard-1.6.2/lib/guard/runner.rb:97:in block (3 levels) in scoped_guards' [#5232DAD6505A] /Users/periclestheodorou/.rvm/gems/ruby-1.9.3-p362/gems/guard-1.6.2/lib/guard/runner.rb:174:ineach’#5232DAD6505A /Users/periclestheodorou/.rvm/gems/ruby-1.9.3-p362中的periclestheodorou/.rvm/gems/ruby-1.9.3-p362/gems/guard-1.6.2/lib/guard/runner.rb:97:in run_supervised_task' [#5232DAD6505A] /Users/periclestheodorou/.rvm/gems/ruby-1.9.3-p362/gems/guard-1.6.2/lib/guard/runner.rb:54:inblock (2级)/gems/ /Users/periclestheodorou/.rvm/gems/ruby-1.9.3-p362/gems/guard-1.6.2/lib/guard/runner.rb:172:in -1.6.2/lib/guard/runner.rb:174:in block (2 levels) in scoped_guards' [#5232DAD6505A] /Users/periclestheodorou/.rvm/gems/ruby-1.9.3-p362/gems/guard-1.6.2/lib/guard/runner.rb:173:incatch‘#5232DAD6505A /Users/periclestheodorou/.rvm/gems/ruby-1.9.3-p362/gems/guard-1.6.2/lib/guard/runner.rb:173:in block in scoped_guards' [#5232DAD6505A] /Users/periclestheodorou/.rvm/gems/ruby-1.9.3-p362/gems/guard-1.6.2/lib/guard/runner.rb:172:ineach’#5232DAD6505A /Users/periclestheodorou/.rvm/gems/ruby-1.9.3-p362/gems/guard-1.6.2/lib/guard/runner.rb:172:inrun‘#5232DAD6505A /Users/periclestheodorou/.rvm/gems/ruby-1.9.3-p362/gems/lumberjack-1.0.2/lib/lumberjack.rb:27:in scoped_guards' [#5232DAD6505A] /Users/periclestheodorou/.rvm/gems/ruby-1.9.3-p362/gems/guard-1.6.2/lib/guard/runner.rb:53:in’#5232DAD6505A /Users/periclestheodorou/.rvm/gems/ruby-1.9.3-p362/gems/guard-1.6.2/lib/guard.rb:187:in block in start' [#5232DAD6505A] /Users/periclestheodorou/.rvm/gems/ruby-1.9.3-p362/gems/guard-1.6.2/lib/guard.rb:363:inblock in within_preserved_state‘#5232DAD6505A :10:in synchronize' [#5232DAD6505A] /Users/periclestheodorou/.rvm/gems/ruby-1.9.3-p362/gems/guard-1.6.2/lib/guard.rb:360:inwithin_preserved_’中的块state‘#5232DAD6505A /Users/periclestheodorou/.rvm/gems/ruby-1.9.3-p362/gems/guard-1.6.2/lib/guard.rb:185:in start' [#5232DAD6505A] /Users/periclestheodorou/.rvm/gems/ruby-1.9.3-p362/gems/guard-1.6.2/lib/guard/cli.rb:110:instart’#5232DAD6505A /Users/periclestheodorou/.rvm/gems/ruby-1.9.3-p362/gems/thor-0.17.0/lib/thor/task.rb:27:in run' [#5232DAD6505A] /Users/periclestheodorou/.rvm/gems/ruby-1.9.3-p362/gems/thor-0.17.0/lib/thor/invocation.rb:120:ininvoke_task‘#5232DAD6505A /Users/periclestheodorou/.rvm/gems/ruby-1.9。3-p362/gems/thor-0.17.0/lib/thor.rb:344:in dispatch' [#5232DAD6505A] /Users/periclestheodorou/.rvm/gems/ruby-1.9.3-p362/gems/thor-0.17.0/lib/thor/base.rb:434:instart‘#5232DAD6505A /Users/periclestheodorou/.rvm/gems/ruby-1.9.3-p362/gems/guard-1.6.2/bin/guard:6:in <top (required)>' [#5232DAD6505A] /Users/periclestheodorou/.rvm/gems/ruby-1.9.3-p362/bin/guard:19:inload’#5232DAD6505A /Users/periclestheodorou/.rvm/gems/ruby-1.9.3-p362/bin/guard:19:in <main>' [#5232DAD6505A] /Users/periclestheodorou/.rvm/gems/ruby-1.9.3-p362/bin/ruby_noexec_wrapper:14:indispatch' [#5232DAD6505A] /Users/periclestheodorou/.rvm/gems/ruby-1.9.3-p362/gems/thor-0.17.0/lib/thor/base.rb:434:in‘#5232DAD6505A /Users/periclestheodorou/.rvm/gems/ruby-1.9.3-p362/bin/ruby_noexec_wrapper:14:in `‘19:01:28 - INFO - Guard::Spork刚刚发射19:01:28 - INFO - Guard::RSpec正在运行,在RSpec 2!19:01:28 - INFO - running all specs的情况下,没有运行DRb服务器。改为在本地进程中运行...找不到任何示例。

在0.0001秒内完成0个示例,0个失败

这里是Gemfile

代码语言:javascript
复制
source 'https://rubygems.org'

gem 'rails', '3.2.11'

group :development, :test do
  gem 'sqlite3', '1.3.5'
  gem 'rspec-rails', '2.11.0'
  gem 'guard-rspec', '1.2.1'
  gem 'guard-spork', '1.2.0'
  gem 'spork', '0.9.2'
end

group :assets do
  gem 'sass-rails', '3.2.5'
  gem 'coffee-rails', '3.2.2'
  gem 'uglifier', '1.2.3'
end

gem 'jquery-rails'

group :test do
  gem 'capybara', '1.1.2'
  gem 'rb-fsevent', '0.9.1', :require => false
end

group :production do
  gem 'pg', '0.12.2'
end

spec_helper

代码语言:javascript
复制
require 'rubygems'
require 'spork'

Spork.prefork do
  # Loading more in this block will cause your tests to run faster. However, 
  # if you change any configuration or code from libraries loaded here, you'll
  # need to restart spork for it take effect.
  # This file is copied to spec/ when you run 'rails generate rspec:install'
  ENV["RAILS_ENV"] ||= 'test'
  require File.expand_path("../../config/environment", __FILE__)
  require 'rspec/rails'
  require 'rspec/autorun'

  # Requires supporting ruby files with custom matchers and macros, etc,
  # in spec/support/ and its subdirectories.
  Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f}

  RSpec.configure do |config|
    # == Mock Framework
    #
    # If you prefer to use mocha, flexmock or RR, uncomment the appropriate line:
    #
    # config.mock_with :mocha
    # config.mock_with :flexmock
    # config.mock_with :rr
    config.mock_with :rspec

    # Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
    config.fixture_path = "#{::Rails.root}/spec/fixtures"

    # If you're not using ActiveRecord, or you'd prefer not to run each of your
    # examples within a transaction, remove the following line or assign false
    # instead of true.
    config.use_transactional_fixtures = true

    # If true, the base class of anonymous controllers will be inferred
    # automatically. This will be the default behavior in future versions of
    # rspec-rails.
    config.infer_base_class_for_anonymous_controllers = false
  end
end

Spork.each_run do
  # This code will be run each time you run your specs.

end
EN

回答 3

Stack Overflow用户

回答已采纳

发布于 2013-01-30 18:03:33

这是一个known issue in guard-spork,您可以通过添加以下内容来使用以前版本的ChildProcess

代码语言:javascript
复制
gem 'childprocess', '0.3.6'

添加到您的Gemfile,或者尝试使用guard-spork分支,其中包含fixed the issue,方法是将以下内容添加到您的Gemfile

代码语言:javascript
复制
gem 'guard-spork', :github => 'guard/guard-spork'
票数 35
EN

Stack Overflow用户

发布于 2013-02-17 00:58:04

正在运行

代码语言:javascript
复制
bundle exec guard

而不是

代码语言:javascript
复制
guard

帮我修好了

票数 2
EN

Stack Overflow用户

发布于 2013-04-25 10:02:58

将Gemfile更新为'guard-spork','1.4.2‘,并为我修复了它。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/14590399

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档