Uzyskanie przez nokogiri nowszej wersji libxml2

Próbowałem zainstalować Nokogiri na moim komputerze (Mountain Lion), aby używać go z rspec i kapibarą, ale przez całe życie nie mogę go uruchomić poprawnie.

Z tego, co mogę powiedzieć, problem dotyczy nokogiri używającego niewłaściwej wersji libxml2. Do tej pory próbowałem odinstalować i ponownie zainstalować libxml2 przy użyciu Homebrew (upewniając się, że jest to najnowszy), odinstalować i ponownie zainstalować nokogiri za pomocą pakietu i określić dokładną ścieżkę do plików libxml2 zainstalowanych przez Homebrew podczas instalacji klejnotu nokogiri. Moje najnowsze instrukcje instalacji wyglądały tak

sudo gem install nokogiri -- --with-xml2-include=/usr/local/Cellar/libxml2/2.9.0/include/libxml2 --with-xml2-lib=/usr/local/Cellar/libxml2/2.9.0/lib --with-xslt-dir=/usr/local/Cellar/libxslt/1.1.28

gdzie wszystkie te lokalizacje prawidłowo odpowiadają lokalizacjom, w których narzędzia są zainstalowane. Jednak po uruchomieniubundle exec rspec spec/requests/static_pages.rb, Wciąż otrzymuję to wyjście:

/Users/alex/.rvm/gems/ruby-1.9.3-p286/gems/nokogiri-1.5.9/lib/nokogiri.rb:28:in `require': dlopen(/Users/alex/.rvm/gems/ruby-1.9.3-p286/gems/nokogiri-1.5.9/lib/nokogiri/nokogiri.bundle, 9): Library not loaded: /usr/local/lib/libxml2.2.dylib (LoadError)
Referenced from: /Users/alex/.rvm/gems/ruby-1.9.3-p286/gems/nokogiri-1.5.9/lib/nokogiri/nokogiri.bundle
Reason: Incompatible library version: nokogiri.bundle requires version 12.0.0 or later, but libxml2.2.dylib provides version 10.0.0 - /Users/alex/.rvm/gems/ruby-1.9.3-p286/gems/nokogiri-1.5.9/lib/nokogiri/nokogiri.bundle
    from /Users/alex/.rvm/gems/ruby-1.9.3-p286/gems/nokogiri-1.5.9/lib/nokogiri.rb:28:in `<top (required)>'
    from /Users/alex/.rvm/gems/ruby-1.9.3-p286@global/gems/bundler-1.3.4/lib/bundler/runtime.rb:72:in `require'
    from /Users/alex/.rvm/gems/ruby-1.9.3-p286@global/gems/bundler-1.3.4/lib/bundler/runtime.rb:72:in `block (2 levels) in require'
    from /Users/alex/.rvm/gems/ruby-1.9.3-p286@global/gems/bundler-1.3.4/lib/bundler/runtime.rb:70:in `each'
    from /Users/alex/.rvm/gems/ruby-1.9.3-p286@global/gems/bundler-1.3.4/lib/bundler/runtime.rb:70:in `block in require'
    from /Users/alex/.rvm/gems/ruby-1.9.3-p286@global/gems/bundler-1.3.4/lib/bundler/runtime.rb:59:in `each'
    from /Users/alex/.rvm/gems/ruby-1.9.3-p286@global/gems/bundler-1.3.4/lib/bundler/runtime.rb:59:in `require'
    from /Users/alex/.rvm/gems/ruby-1.9.3-p286@global/gems/bundler-1.3.4/lib/bundler.rb:132:in `require'
    from /Users/alex/Sites/harbingernews/config/application.rb:7:in `<top (required)>'
    from /Users/alex/Sites/harbingernews/config/environment.rb:2:in `require'
    from /Users/alex/Sites/harbingernews/config/environment.rb:2:in `<top (required)>'
    from /Users/alex/Sites/harbingernews/spec/spec_helper.rb:3:in `require'
    from /Users/alex/Sites/harbingernews/spec/spec_helper.rb:3:in `<top (required)>'
    from /Users/alex/Sites/harbingernews/spec/requests/static_pages_spec.rb:1:in `require'
    from /Users/alex/Sites/harbingernews/spec/requests/static_pages_spec.rb:1:in `<top (required)>'
    from /Users/alex/.rvm/gems/ruby-1.9.3-p286/gems/rspec-core-2.9.0/lib/rspec/core/configuration.rb:746:in `load'
    from /Users/alex/.rvm/gems/ruby-1.9.3-p286/gems/rspec-core-2.9.0/lib/rspec/core/configuration.rb:746:in `block in load_spec_files'
    from /Users/alex/.rvm/gems/ruby-1.9.3-p286/gems/rspec-core-2.9.0/lib/rspec/core/configuration.rb:746:in `map'
    from /Users/alex/.rvm/gems/ruby-1.9.3-p286/gems/rspec-core-2.9.0/lib/rspec/core/configuration.rb:746:in `load_spec_files'
    from /Users/alex/.rvm/gems/ruby-1.9.3-p286/gems/rspec-core-2.9.0/lib/rspec/core/command_line.rb:22:in `run'
    from /Users/alex/.rvm/gems/ruby-1.9.3-p286/gems/rspec-core-2.9.0/lib/rspec/core/runner.rb:69:in `run'
    from /Users/alex/.rvm/gems/ruby-1.9.3-p286/gems/rspec-core-2.9.0/lib/rspec/core/runner.rb:10:in `block in autorun'

Próbowałem wszystkich kroków, które znalazłem w Internecie (większość z nich odwołuje się do budowania i ładowania różnych wersji libxml2, jakten, ale jeszcze nie odnieśliśmy sukcesu. Można znaleźć My Gemfile i Gemfile.locktutaj. Jeśli ktokolwiek może mi pomóc, naprawdę bym to docenił. Nie mogłem znaleźć żadnych innych przypadków online z tym problemem.

questionAnswers(4)

yourAnswerToTheQuestion