2013-06-20 5 views
12

पर कैपिस्ट्रानो परिनियोजन करते समय नोकोगिरी के बारे में त्रुटि bundle:installdeploy:finalize_update के बाद चरण, मुझे नोकोगिरी के बारे में त्रुटि मिल रही है। यह चलता है कि यह निम्न त्रुटि देता हैउबंटू सर्वर

** [out :: *******] Make sure that `gem install nokogiri -v '1.6.0'` succeeds before bundling. 

तो मैं server.But पर अपने आप से nokogiri स्थापित करने के लिए कोशिश की,,

Building native extensions. This could take a while... 
ERROR: Error installing nokogiri: 
    ERROR: Failed to build gem native extension. 

    /home/deployer/.rvm/rubies/ruby-2.0.0-p0/bin/ruby extconf.rb 
Extracting libxml2-2.8.0.tar.gz into tmp/x86_64-linux-gnu/ports/libxml2/2.8.0... OK 
Running 'configure' for libxml2 2.8.0... OK 
Running 'compile' for libxml2 2.8.0... ERROR, review 'tmp/x86_64-linux-gnu/ports/libxml2/2.8.0/compile.log' to see what happened. 
*** extconf.rb failed *** 
Could not create Makefile due to some reason, probably lack of necessary 
libraries and/or headers. Check the mkmf.log file for more details. You may 
need configuration options. 

Provided configuration options: 
    --with-opt-dir 
    --without-opt-dir 
    --with-opt-include 
    --without-opt-include=${opt-dir}/include 
    --with-opt-lib 
    --without-opt-lib=${opt-dir}/lib 
    --with-make-prog 
    --without-make-prog 
    --srcdir=. 
    --curdir 
    --ruby=/home/deployer/.rvm/rubies/ruby-2.0.0-p0/bin/ruby 
/home/deployer/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/gems/2.0.0/gems/mini_portile-0.5.0/lib/mini_portile.rb:235:in `block in execute': Failed to complete compile task (RuntimeError) 
    from /home/deployer/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/gems/2.0.0/gems/mini_portile-0.5.0/lib/mini_portile.rb:227:in `chdir' 
    from /home/deployer/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/gems/2.0.0/gems/mini_portile-0.5.0/lib/mini_portile.rb:227:in `execute' 
    from /home/deployer/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/gems/2.0.0/gems/mini_portile-0.5.0/lib/mini_portile.rb:61:in `compile' 
    from /home/deployer/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/gems/2.0.0/gems/mini_portile-0.5.0/lib/mini_portile.rb:101:in `cook' 
    from extconf.rb:101:in `block in <main>' 
    from extconf.rb:119:in `call' 
    from extconf.rb:119:in `block in <main>' 
    from extconf.rb:109:in `tap' 
    from extconf.rb:109:in `<main>' 


Gem files will remain installed in /home/deployer/.rvm/gems/ruby-2.0.0-p0/gems/nokogiri-1.6.0 for inspection. 
Results logged to /home/deployer/.rvm/gems/ruby-2.0.0-p0/gems/nokogiri-1.6.0/ext/nokogiri/gem_make.out 

यह सिर्फ today.Also libxml2 पहले से स्थापित है शुरू कर दिया।

कोई विचार?

धन्यवाद।

संपादित करें: मुझे अपने रत्न में स्पष्ट रूप से नोकोगिरी की आवश्यकता नहीं है।

+1

मेरे पास एक विचार है: क्या हुआ यह देखने के लिए 'tmp/x86_64-linux-gnu/ports/libxml2/2.8.0/compile.log' की समीक्षा करें। –

+1

:) फ़ाइल मौजूद नहीं है –

+0

मैंने अपनी मणि फ़ाइल में नोकोगिरी जोड़ा और इसका हल हो गया। लेकिन मुझे एक चेतावनी देता है। चेतावनी: Nokogiri LibXML संस्करण 2.9.1 के खिलाफ बनाया गया था, लेकिन गतिशील रूप से लोड किया गया है 2.8.0 –

उत्तर

37

मुझे नोकोगिरी 1.6.0 के साथ एक ही समस्या का सामना करना पड़ा। समस्या, जैसा कि आप लॉग से देख सकते हैं, यह libxml2 के असफल संकलन के कारण होता है, जो libxslt के साथ अब मणि में एम्बेडेड भेज दिया जाता है और इसे इंस्टॉल करते समय संकलित किया जाता है।

पता लगाने के लिए वास्तव में क्या, संकलन के साथ गलत हो गया था सुझाव दिया फ़ाइल compile.log कि, आपके मामले में, आप पर पा सकते हैं पर एक नजर है:

/home/deployer/.rvm/gems/ruby-2.0.0-p0/gems/nokogiri-1.6.0/ext/nokogiri/tmp/x86_64-linux-gnu/ports/libxml2/2.8.0/compile.log 

समाधान के लिए (यह मानते हुए आपके पास libxml2-dev और libxslt-dev स्थापित है), आप कर सकते हैं:

NOKOGIRI_USE_SYSTEM_LIBRARIES=1 bundle install 

मुझे उम्मीद है कि इससे मदद मिलती है।

task :custom_bundle_install, roles: :app do 
    run "cd /home/#{user}/apps/#{application}/releases/#{release_name} && NOKOGIRI_USE_SYSTEM_LIBRARIES=1 bundle install --gemfile /home/#{user}/apps/#{application}/releases/#{release_name}/Gemfile --path /home/#{user}/apps/#{application}/shared/bundle --deployment --quiet --without development test" 
    end 
    before "bundle:install", "deploy:custom_bundle_install" 

यह मेरे लिए बहुत अच्छी तरह से काम किया:

+0

कामकाज के लिए धन्यवाद! मुझे लगता है कि यह निश्चित रूप से मेरे लिए एक होमब्री मुद्दा है, लेकिन Google-Fu को ठीक करने का कोई समय नहीं है। – engineerDave

+0

आपने कामकाज भी मेरे लिए काम किया। लेकिन अभी भी मुझे चेतावनी दे रहा है। इस बारे में कोई खोला मुद्दा? शायद हम इस सवाल को संलग्न कर सकते हैं। –

+1

इसे @tiago से उत्तर शामिल करने के लिए विस्तारित किया जाना चाहिए – nunopolonia

0

@zekus जवाब के आधार पर, मैं इस तरह Capistrano में एक नया कार्य बनाया।

11

आप Capistrano 3.x उपयोग कर रहे हैं तो आप अपने deploy.rb फ़ाइल (या पर्यावरण विशिष्ट फ़ाइल अर्थात deploy/production.rb) में निम्नलिखित

set :bundle_env_variables, { 'NOKOGIRI_USE_SYSTEM_LIBRARIES' => 1 } 

इस तरह आप bundle install कार्य अधिभावी से बचने कर सकते हैं। bundle install चलाते समय यह env चर सेट करेगा।

0

कनेक्ट आप उपयोगकर्ता deployer साथ होस्ट करने के लिए, की तुलना में कोशिश खुद के द्वारा बंडल स्थापित:

cd {your last release path} 
bundle config build.nokogiri --with-xml2-include=/usr/include/libxml2/libxml 
bundle install --gemfile Gemfile --path shared/bundle --deployment --quiet --without development test 

रन Capistrano मैन्युअल रूप से।

यह मेरे लिए काम किया।