2

Michael Hartl のチュートリアルから Ruby を学んでいます。1つ1つ手順を踏んでいますが、これを通過できません。「bundle exec rspec spec/requests/static_pages_spec.rb」と入力すると、単純な「1 つの例、0 の失敗」ではなく、非常に長いエラー応答が返されます。静的ページのディレクトリで必要なコードを変更しました。コードをコピーして貼り付けただけなので、コードが正しいと確信しています。エラーメッセージは次のとおりです。

/Users/marlon/.rvm/gems/ruby-1.9.2-p320/gems/nokogiri-1.6.0/lib/nokogiri.rb:28:in `require': dlopen(/Users/marlon/.rvm/gems/ruby-1.9.2-p320/gems/nokogiri-1.6.0/lib/nokogiri/nokogiri.bundle, 9): Library not loaded: /Users/marlon/.bundler/tmp/1219/gems/nokogiri-1.6.0/ports/i686-apple-darwin11/libxml2/2.8.0/lib/libxml2.2.dylib (LoadError)
  Referenced from: /Users/marlon/.rvm/gems/ruby-1.9.2-p320/gems/nokogiri-1.6.0/lib/nokogiri/nokogiri.bundle
  Reason: Incompatible library version: nokogiri.bundle requires version 11.0.0 or later, but libxml2.2.dylib provides version 10.0.0 - /Users/marlon/.rvm/gems/ruby-1.9.2-p320/gems/nokogiri-1.6.0/lib/nokogiri/nokogiri.bundle
    from /Users/marlon/.rvm/gems/ruby-1.9.2-p320/gems/nokogiri-1.6.0/lib/nokogiri.rb:28:in `<top (required)>'
    from /Users/marlon/.rvm/gems/ruby-1.9.2-p320/gems/capybara-1.1.2/lib/capybara.rb:2:in `require'
    from /Users/marlon/.rvm/gems/ruby-1.9.2-p320/gems/capybara-1.1.2/lib/capybara.rb:2:in `<top (required)>'
    from /Users/marlon/.rvm/gems/ruby-1.9.2-p320@global/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in `require'
    from /Users/marlon/.rvm/gems/ruby-1.9.2-p320@global/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in `block (2 levels) in require'
    from /Users/marlon/.rvm/gems/ruby-1.9.2-p320@global/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in `each'
    from /Users/marlon/.rvm/gems/ruby-1.9.2-p320@global/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in `block in require'
    from /Users/marlon/.rvm/gems/ruby-1.9.2-p320@global/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `each'
    from /Users/marlon/.rvm/gems/ruby-1.9.2-p320@global/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `require'
    from /Users/marlon/.rvm/gems/ruby-1.9.2-p320@global/gems/bundler-1.3.5/lib/bundler.rb:132:in `require'
    from /Users/marlon/rails_projects/sample_app/config/application.rb:7:in `<top (required)>'
    from /Users/marlon/rails_projects/sample_app/config/environment.rb:2:in `require'
    from /Users/marlon/rails_projects/sample_app/config/environment.rb:2:in `<top (required)>'
    from /Users/marlon/rails_projects/sample_app/spec/spec_helper.rb:3:in `require'
    from /Users/marlon/rails_projects/sample_app/spec/spec_helper.rb:3:in `<top (required)>'
    from /Users/marlon/rails_projects/sample_app/spec/requests/static_pages_spec.rb:1:in `require'
    from /Users/marlon/rails_projects/sample_app/spec/requests/static_pages_spec.rb:1:in `<top (required)>'
    from /Users/marlon/.rvm/gems/ruby-1.9.2-p320/gems/rspec-core-2.11.1/lib/rspec/core/configuration.rb:780:in `load'
    from /Users/marlon/.rvm/gems/ruby-1.9.2-p320/gems/rspec-core-2.11.1/lib/rspec/core/configuration.rb:780:in `block in load_spec_files'
    from /Users/marlon/.rvm/gems/ruby-1.9.2-p320/gems/rspec-core-2.11.1/lib/rspec/core/configuration.rb:780:in `map'
    from /Users/marlon/.rvm/gems/ruby-1.9.2-p320/gems/rspec-core-2.11.1/lib/rspec/core/configuration.rb:780:in `load_spec_files'
    from /Users/marlon/.rvm/gems/ruby-1.9.2-p320/gems/rspec-core-2.11.1/lib/rspec/core/command_line.rb:22:in `run'
    from /Users/marlon/.rvm/gems/ruby-1.9.2-p320/gems/rspec-core-2.11.1/lib/rspec/core/runner.rb:69:in `run'
    from /Users/marlon/.rvm/gems/ruby-1.9.2-p320/gems/rspec-core-2.11.1/lib/rspec/core/runner.rb:8:in `block in autorun'
dyn172-30-28-254:sample_app marlon$

これを修正するために私にできることを教えてください。すべての助けに感謝します、事前に感謝します!

4

1 に答える 1

3

nokogiri の依存関係をインストールする必要があります。

brew install libxml2 --with-xml2-config
brew install libxslt
于 2013-06-19T18:24:49.690 に答える