0

gem をアップグレードして古いプロジェクトを復活させようとしています。「--drb」オプションを使用した起動時に RSpec がハングする問題が発生しました。

'rspec spec' 自体は正常に動作します。しかし、別の端末で 'spork' を起動すると、'rspec --drb spec' で CPU が最大 40% までスピンアップし、そのまま待機します。

Rails 3.2.13、Ruby 1.9.3-p392、RSpec 2.13.1、および Spork 1.0.0rc3 に依存する spork-rails 3.2.1 を使用します。

Gemfile

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/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

brew update ruby-build2013-05-01 日付の新しいバージョンをピックアップしてruby​​-build をアップグレードしました。更新後、すべての Ruby を破棄して再インストールしたところ、問題は解決したようです。

何が問題に具体的に対処したのかはわかりませんが、いくつかのメモと関連するコミットがあります: https://github.com/sstephenson/ruby-build/commit/9f8d53365aef52c940095f583cdc82f02caba90f

于 2013-05-05T23:32:34.113 に答える