Ruby on rails 运行rspec时出错?

Ruby on rails 运行rspec时出错?,ruby-on-rails,ruby,rspec,nokogiri,Ruby On Rails,Ruby,Rspec,Nokogiri,我正在开发一个Rails应用程序,并使用Rspec进行测试。不幸的是,当我尝试运行bundle exec rspec时,我遇到了一大堆错误文本(如下所示) 我看到的第一行是关于Nokogiri的警告,但我怀疑这与当前的主要问题无关 WARNING: Nokogiri was built against LibXML version 2.8.0, but has dynamically loaded 2.7.8 Could not open library 'kernel32': dlopen(

我正在开发一个Rails应用程序,并使用Rspec进行测试。不幸的是,当我尝试运行
bundle exec rspec
时,我遇到了一大堆错误文本(如下所示)

我看到的第一行是关于Nokogiri的警告,但我怀疑这与当前的主要问题无关

WARNING: Nokogiri was built against LibXML version 2.8.0, but has dynamically loaded 2.7.8

Could not open library 'kernel32': dlopen(kernel32, 5): image not found.
Could not open library 'libkernel32.dylib': dlopen(libkernel32.dylib, 5): image not found (LoadError)
/usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/ffi-1.9.0/lib/ffi/library.rb:123:in `block in ffi_lib'
/usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/ffi-1.9.0/lib/ffi/library.rb:90:in `map'
/usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/ffi-1.9.0/lib/ffi/library.rb:90:in `ffi_lib'
/usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/rb-fchange-0.0.5/lib/rb-fchange/native.rb:10:in `<module:Native>'
/usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/rb-fchange-0.0.5/lib/rb-fchange/native.rb:8:in `<module:FChange>'
/usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/rb-fchange-0.0.5/lib/rb-fchange/native.rb:3:in `<top (required)>'
/usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require'
/usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `block in require'
/usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:236:in `load_dependency'
/usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require'
/usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/rb-fchange-0.0.5/lib/rb-fchange.rb:1:in `<top (required)>'
/usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in `require'
/usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in `block (2 levels) in require'
/usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in `each'
/usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in `block in require'
/usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `each'
/usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `require'
/usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler.rb:132:in `require'
/Users/varunrau/Documents/curr/BPSF/config/application.rb:7:in `<top (required)>'
/usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:45:in `require'
/usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:45:in `require'
/usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/spork-0.9.2/lib/spork/app_framework/rails.rb:48:in `preload_rails'
/usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/spork-0.9.2/lib/spork/app_framework/rails.rb:7:in `preload'
/usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/spork-0.9.2/lib/spork/test_framework.rb:134:in `block in preload'
/usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/spork-0.9.2/lib/spork.rb:62:in `exec_prefork'
/usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/spork-0.9.2/lib/spork/test_framework.rb:120:in `preload'
/usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/spork-0.9.2/lib/spork/run_strategy/forking.rb:25:in `preload'
/usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/spork-0.9.2/lib/spork/runner.rb:74:in `run'
/usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/spork-0.9.2/lib/spork/runner.rb:10:in `run'
/usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/spork-0.9.2/bin/spork:10:in `<top (required)>'
/usr/local/Cellar/ruby/1.9.3-p194/bin/spork:23:in `load'
/usr/local/Cellar/ruby/1.9.3-p194/bin/spork:23:in `<main>'
警告:Nokogiri是根据LibXML版本2.8.0构建的,但动态加载了2.7.8
无法打开库“kernel32”:dlopen(kernel32,5):找不到映像。
无法打开库“libkernel32.dylib”:dlopen(libkernel32.dylib,5):找不到映像(LoadError)
/usr/local/ceral/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/ffi-1.9.0/lib/ffi/library.rb:123:in`block in ffi_lib'
/usr/local/ceral/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/ffi-1.9.0/lib/ffi/library.rb:90:in'map'
/usr/local/ceral/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/ffi-1.9.0/lib/ffi/library.rb:90:in'ffi_lib'
/usr/local/ceral/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/rb-fchange-0.0.5/lib/rb-fchange/native.rb:10:in`'
/usr/local/ceral/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/rb-fchange-0.0.5/lib/rb-fchange/native.rb:8:in`'
/usr/local/ceral/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/rb-fchange-0.0.5/lib/rb-fchange/native.rb:3:in`'
/usr/local/ceral/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/activesupport-3.2.13/lib/active\u-support/dependencies.rb:251:in'require'
/usr/local/ceral/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/activesupport-3.2.13/lib/active\u-support/dependencies.rb:251:in'block in require'
/usr/local/ceral/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/activesupport-3.2.13/lib/active\u support/dependencies.rb:236:in'load\u dependenciency'
/usr/local/ceral/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/activesupport-3.2.13/lib/active\u-support/dependencies.rb:251:in'require'
/usr/local/ceral/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/rb-fchange-0.0.5/lib/rb-fchange.rb:1:in`'
/usr/local/ceral/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in'require'
/usr/local/ceral/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:在“请求中的块(2个级别)”中
/usr/local/ceral/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in'each'
/usr/local/ceral/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in'block in require'
/usr/local/ceral/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in'each'
/usr/local/ceral/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in'require'
/usr/local/ceral/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler.rb:132:in'require'
/Users/varunrau/Documents/curr/BPSF/config/application.rb:7:in`'
/usr/local/ceral/ruby/1.9.3-p194/lib/ruby/site\u ruby/1.9.1/rubygems/core\u ext/kernel\u require.rb:45:in'require'
/usr/local/ceral/ruby/1.9.3-p194/lib/ruby/site\u ruby/1.9.1/rubygems/core\u ext/kernel\u require.rb:45:in'require'
/usr/local/ceral/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/spork-0.9.2/lib/spork/app_framework/rails.rb:48:in'preload_rails'
/usr/local/ceral/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/spork-0.9.2/lib/spork/app_framework/rails.rb:7:in'preload'
/usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/spork-0.9.2/lib/spork/test_framework.rb:134:在“预加载块”中
/usr/local/ceral/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/spork-0.9.2/lib/spork.rb:62:in'exec_prefork'
/usr/local/ceral/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/spork-0.9.2/lib/spork/test_framework.rb:120:in'preload'
/usr/local/ceral/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/spork-0.9.2/lib/spork/run_strategy/forking.rb:25:in'preload'
/usr/local/ceral/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/spork-0.9.2/lib/spork/runner.rb:74:in'run'
/usr/local/ceral/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/spork-0.9.2/lib/spork/runner.rb:10:in'run'
/usr/local/ceral/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/spork-0.9.2/bin/spork:10:in`'
/usr/local/Cellar/ruby/1.9.3-p194/bin/spork:23:in'load'
/usr/local/ceral/ruby/1.9.3-p194/bin/spork:23:in`'
我的系统详细信息是:OSX10.8、Rails 3.2.13、Ruby 1.9.3p194。我试着按照这个网站上的一些建议重新安装Ruby和rb fchange gem,但没有任何效果


非常感谢你的帮助

这个问题看起来很相似,但这些建议似乎都无济于事。是否可以使用gem的(rb fchange)方法对代码进行注释,然后再次尝试运行规范?在gem文件和其他地方注释掉Nokogiri,然后运行
bundle
。你的测试会在Nokogiri被注释掉的情况下启动吗?@tyler我试着注释Nokogiri,但是我仍然收到了错误,但是警告消失了。所以看起来他们是无关的。@gotva我认为这是不可能的。我没有使用这个gem编写任何代码(老实说,我以前从未听说过它)。