我在我的 Gemfile 中添加了防护和 rb-notify 并运行包:
gem 'guard-rspec', '1.2.1', :group => :test
gem 'rb-inotify', '0.8.8', :group => [:development, :test]
gem 'libnotify', '0.5.9', :group => [:development, :test]
但是,当我运行 bundle exec spork 时,我得到以下信息:
bundle exec guard
10:47:09 - INFO - Guard uses Libnotify to send notifications.
10:47:09 - INFO - Guard uses TerminalTitle to send notifications.
10:47:09 - INFO - Guard is now watching at '/home/paul/work/test-demo'
10:47:09 - INFO - Guard::RSpec is running, with RSpec 2!
10:47:09 - INFO - Running all specs
Running tests with args ["--drb", "-f", "progress", "-r", "/home/paul/.rvm/gems/ruby-1.9.2-p290@test-demo/gems/guard-rspec-1.2.1/lib/guard/rspec/formatters/notification_rspec.rb", "-f", "Guard::RSpec::Formatter::NotificationRSpec", "--out", "/dev/null", "--failure-exit-code", "2", "spec"]...
Done.
/home/paul/.rvm/gems/ruby-1.9.2-p290@test-demo/gems/ffi-1.1.5/lib/ffi_c.so: [BUG] Segmentation fault
ruby 1.8.7 (2010-01-10 patchlevel 249) [x86_64-linux]
Aborted
我猜它是 1.8.7 和 1.9.2 的东西。我正在运行 rvm 和 1.9.2。ruby -v
告诉我 1.9.2,但 seg 错误似乎与 1.8.7 相关。
我的保护文件非常简单:
guard 'rspec', :version => 2, :all_after_pass => false, :cli => '--drb' do
watch(%r{^spec/.+_spec\.rb$})
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
watch('spec/spec_helper.rb') { "spec" }
# Rails example
watch(%r{^app/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
watch(%r{^app/(.*)(\.erb|\.haml)$}) { |m| "spec/#{m[1]}#{m[2]}_spec.rb" }
watch(%r{^app/controllers/(.+)_(controller)\.rb$}) { |m| ["spec/routing/#{m[1]}_routing_spec.rb", "spec/#{m[2]}s/#{m[1]}_#{m[2]}_spec.rb", "spec/acceptance/#{m[1]}_spec.rb"]
watch(%r{^spec/support/(.+)\.rb$}) { "spec" }
watch('config/routes.rb') { "spec/routing" }
watch('app/controllers/application_controller.rb') { "spec/controllers" }
# Capybara request specs
watch(%r{^app/views/(.+)/.*\.(erb|haml)$}) { |m| "spec/requests/#{m[1]}_spec.rb" }
end
有什么想法我可能会出错吗?编辑:奇怪的是,当我更改为使用 Ruby 1.8.7 时它可以工作(在更改了许多其他依赖于 1.9.2 的 gem/代码之后)。不过,我仍然想使用更高版本的 ruby