के एक नए संस्करण का उपयोग करने के लिए नोकोगिरी प्राप्त करना मैं rspec और capybara के साथ उपयोग करने के लिए अपने कंप्यूटर (माउंटेन शेर) पर नोकोगिरी स्थापित करने की कोशिश कर रहा हूं, लेकिन मेरे जीवन के लिए, मैं इसे चलाने के लिए नहीं मिल सकता अच्छी तरह।libxml2
जो मैं कह सकता हूं, यह मुद्दा libxml2 के गलत संस्करण का उपयोग करके नोकोगिरी के साथ है। मैंने अब तक होमब्रे का उपयोग करके libxml2 को अनइंस्टॉल करने और पुनर्स्थापित करने का प्रयास किया है (सुनिश्चित करें कि यह सबसे हालिया है), अनइंस्टॉल करना और बंडल का उपयोग करके नोकोगिरी को पुनर्स्थापित करना, और libxml2 फ़ाइलों के सटीक पथ को निर्दिष्ट करना जो होमोक्रू को नोकोगिरी मणि इंस्टॉल करते समय स्थापित किया गया है। मेरा सबसे हाल ही स्थापित निर्देश इस
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
जहां उन सभी स्थानों को सही ढंग से जिन स्थानों पर उपकरण स्थापित कर रहे हैं के अनुरूप है की तरह लग रहा था। हालांकि, bundle exec rspec spec/requests/static_pages.rb
चल पर, मैं अभी भी इस आउटपुट प्राप्त:
/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/[email protected]/gems/bundler-1.3.4/lib/bundler/runtime.rb:72:in `require'
from /Users/alex/.rvm/gems/[email protected]/gems/bundler-1.3.4/lib/bundler/runtime.rb:72:in `block (2 levels) in require'
from /Users/alex/.rvm/gems/[email protected]/gems/bundler-1.3.4/lib/bundler/runtime.rb:70:in `each'
from /Users/alex/.rvm/gems/[email protected]/gems/bundler-1.3.4/lib/bundler/runtime.rb:70:in `block in require'
from /Users/alex/.rvm/gems/[email protected]/gems/bundler-1.3.4/lib/bundler/runtime.rb:59:in `each'
from /Users/alex/.rvm/gems/[email protected]/gems/bundler-1.3.4/lib/bundler/runtime.rb:59:in `require'
from /Users/alex/.rvm/gems/[email protected]/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'
मैं सभी कदम है कि मैं ऑनलाइन पाया है की कोशिश की है (सबसे संदर्भ निर्माण और libxml2 के विभिन्न संस्करणों लोड हो रहा है, this one की तरह है, लेकिन कोई पड़ा है सफलता अभी तक। मेरे Gemfile और Gemfile.lock here पाया जा सकता है। किसी को भी मुझे बिल्कुल भी मदद कर सकते हैं, मैं वास्तव में सराहना करते हैं यह। मैं नहीं इस समस्या से ऑनलाइन किसी भी अन्य मामलों को खोजने के लिए सक्षम किया गया होगा।
'brew --prefix libxml2' का आउटपुट क्या है? नोकोगिरी/एक्सटी/नोकोगिरी/में सुगंध के लिए extconf.rb फ़ाइल देखें जहां नोकोगिरी libs और हेडर फाइलों की तलाश में है। –
यहाँ उत्पादन है: /usr/स्थानीय/opt/libxml2 मैं फ़ाइल आप की बात कर रहे थे पाया और मुझे लगता है कि मैं समझता हूँ कि यह क्या हर तरह, हालांकि मैं वास्तव में अनिश्चित हूँ। क्या मुझे होमब्रू से पथों को जांचने के लिए स्थानों की सूची में जोड़ना चाहिए? यदि मैं ऐसा करता हूं, तो libxml2 के पुराने, गलत संस्करण का उपयोग करना बंद कर देगा? – alexlafroscia
क्या आपने पढ़ा है _ [क्या करना है यदि libxml2 एक झटका है] (https://github.com/sparklemotion/nokogiri/wiki/What-to-do-if-libxml2-is-being-a-jerk) _ ? – Phrogz