0

试图通过升级 gem 来复活一个旧项目。遇到了 RSpec 使用“--drb”选项在启动时挂起的问题。

就其本身而言,'rspec spec' 工作正常。但是在另一个终端中启动“spork”,然后“rspec --drb spec”将 CPU 旋转到 ~40% 并坐下。

使用 Rails 3.2.13、Ruby 1.9.3-p392、RSpec 2.13.1 和 spork-rails 3.2.1,这取决于 Spork 1.0.0rc3。

宝石文件

source 'http://rubygems.org'

gem 'rails', '~> 3.2.13'

gem 'devise', '~> 2.2.0'
gem 'event-calendar', :require => 'event_calendar'
gem 'has_scope'
gem 'high_voltage'
gem 'inherited_resources'
gem 'jquery-rails'
gem 'kaminari'
gem 'ransack'
gem 'simple_form'
gem 'validates_timeliness'

# deployment process management
gem 'foreman'
gem 'thin'

# Gems used only for assets and not required
# in production environments by default.
group :assets do
  gem 'sass-rails', '~> 3.2.3'
  gem 'coffee-rails', '~> 3.2.1'
  gem 'uglifier', '< 2.0'
  gem 'bootstrap-sass', '~> 2.3.1'
end

group :production do
  gem 'pg'
end

group :development, :test do
  gem 'factory_girl_rails', '~> 4.2.0'
  gem 'rspec-rails', '~> 2.13.1'
  gem 'spork-rails'
  gem 'sqlite3'
end

group :test do
  gem 'capybara'
  gem 'growl'
  gem 'launchy'
  gem 'ruby-prof'
  gem 'test-unit'
end

规范/spec_helper.rb

require 'rubygems'
require 'spork'
#uncomment the following line to use spork with the debugger
#require 'spork/ext/ruby-debug'

Spork.prefork do

  # Prevent Devise from loading the User model super early with it's routes
  # see: https://github.com/sporkrb/spork/wiki/Spork.trap_method-Jujitsu
  require "rails/application"
  Spork.trap_method(Rails::Application::RoutesReloader, :reload!)

  # 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'

  # Since I have included Test::Unit for perfomance tests, disable auto-run
  Test::Unit::AutoRunner.need_auto_run = false if defined?(Test::Unit::AutoRunner)

  # 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

    # 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

    # Run specs in random order to surface order dependencies. If you find an
    # order dependency and want to debug it, you can fix the order by providing
    # the seed, which is printed after each run.
    #     --seed 1234
    config.order = "random"
  end

end

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

end

我在控制台上没有收到任何错误消息或反馈,所以我什至不知道从哪里开始寻找问题。有什么建议么?

4

1 回答 1

1

升级 ruby​​-build viabrew update ruby-build选择了一个日期为 2013-05-01 的新版本。更新后,我删除并重新安装了所有的红宝石,问题似乎已经解决了。

我不知道具体解决了这个问题,但这里有一些注释和相关的提交:https ://github.com/sstephenson/ruby-build/commit/9f8d53365aef52c940095f583cdc82f02caba90f

于 2013-05-05T23:32:34.113 回答