मुझे उपरोक्त विन्यास के साथ सर्वर मिला।बंडलर + आरवीएम + यात्री + कैपिस्ट्रानो तैनाती और गायब रत्न
यह मेरा deploy.rb नुस्खा की महत्वपूर्ण हिस्सा है:,
$:.unshift(File.expand_path('./lib', ENV['rvm_path']))
require 'rvm/capistrano'
require 'bundler/capistrano'
set :rvm_ruby_string, 'ruby-1.9.2-p290'
set :rvm_type, :system
set :bundle_flags, "--deployment"
set :default_environment, {
'PATH' => ENV['PATH'],
'RAILS_ENV' => ENV['RAILS_ENV']
}
set :stages, %w(staging production)
require 'capistrano/ext/multistage'
cap staging deploy
चल रहा है उसी रूप में एक त्रुटि की ओर जाता है:
* executing "cd /mnt/data-store/project/releases/shared &&
bundle install --gemfile /mnt/data-store/project/releases/shared/Gemfile
--path /mnt/data-store/project/shared/bundle --deployment --without development test"
** [out :: localhost] The --deployment flag requires a Gemfile.lock.
Please make sure you have checked your Gemfile.lock into version control
before deploying.
... rolling back ...
failed: "env PATH=... RAILS_ENV=staging rvm_path=/usr/local/rvm /usr/local/rvm/bin/rvm-shell 'ruby-1.9.2-p290' -c 'cd /mnt/data-store/project/releases/shared && bundle install --gemfile /mnt/data-store/project/releases/shared/Gemfile --path /mnt/data-store/project/shared/bundle --deployment --without development test'" on localhost
Gemfile और Gemfile.lock स्रोत नियंत्रण में हैं । मैं .lock फ़ाइल उत्पन्न करने के लिए स्थानीय रूप से पहले bundle install
चला गया। लेकिन बंडलर/कैपिस्ट्रानो अंक/mnt/डेटा-स्टोर/प्रोजेक्ट/रिलीज़/साझा/जेमफाइल को इंगित करता है, इसलिए मैंने मैन्युअल रूप से दोनों फाइलों की प्रतिलिपि बनाई है। मुझे यकीन है कि मैं इसे गलत कर रहा हूं। मुझे लगता है कि इसे स्वचालित रूप से कॉपी किया जाना चाहिए।
निष्पादित तैनाती फिर से (1) और यह बंडल पर असफल नहीं किया स्थापित करते हैं, तो यह और भी
Your bundle is complete! It was installed into /mnt/data-store/project/shared/bundle
उत्पादन में किया था।
लेकिन, मेरे कैप कार्यों में से एक रेक को निष्पादित करता है। इसका नतीजा यह है: * किसी भी स्रोत में 0c* bcrypt-ruby-3.0.1 नहीं मिला * bundle install
चलाने का प्रयास करें।
मेरे साहस के साथ आगे बढ़ते हुए, मैंने पाया कि एक बार आपके पास BUNDLE_PATH: /mnt/data-store/project/shared/bundle
के साथ .bundle/config है। मेरे पास यह निर्देशिका थी, शायद /mnt/data-store/releases/shared/
के तहत, बंडलर द्वारा बनाई गई, इसलिए मैंने मैन्युअल रूप से रेल रूट पर प्रतिलिपि बनाई।
अब, रेक/रेल सी काम करते हैं।
bundle show twitter
.../shared/bundle/ruby/1.9.1/gems/twitter-1.7.1
दिखाता है।
लेकिन, पुनर्वितरण मुझे वापस (1) लाता है, क्योंकि .bundle dir वहां नहीं है।
कंक्रीट सवाल:
- मैं/मैन्युअल रूप से कॉपी .bundle/config बनाने की जरूरत है?
- क्या मुझे जेमफाइल/जेमफाइल की प्रतिलिपि बनाने की ज़रूरत है। साझा डीआईआर को मैन्युअल रूप से लॉक करें? अगर मैं रत्न जोड़ता हूं तो क्या होता है? क्या मुझे दो प्रतियां रखना चाहिए, या मैन्युअल रूप से/प्रोग्रामेटिक रूप से उन्हें सिंक करना चाहिए?
- मैं गलत क्या कर रहा हूँ?
धन्यवाद!
धन्यवाद! मुझे अभी भी नहीं मिलता है कि वास्तविक रिलीज के बजाय साझा पथ को 'current_release' क्यों इंगित करता है। – elado