{"id":264468,"date":"2015-08-28T11:34:02","date_gmt":"2015-08-28T07:34:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=264468"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=264468","title":{"rendered":"\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0438 \u0434\u0435\u043f\u043b\u043e\u044f: rvm, rails, puma, nginx, mina"},"content":{"rendered":"<br \/>\n<h2>\u041f\u0440\u0435\u0434\u044b\u0441\u0442\u043e\u0440\u0438\u044f<\/h2>\n<p>  \u041d\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 \u043c\u0435\u043d\u044f \u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0430 \u043d\u0435\u0434\u0430\u0432\u043d\u044f\u044f <a href=\"http:\/\/habrahabr.ru\/post\/265459\/\">\u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u044f \u043e \u0434\u0435\u043f\u043b\u043e\u0435<\/a>. \u0412 \u043f\u0440\u0438\u0432\u0435\u0434\u0451\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043e\u043f\u0438\u0441\u0430\u043d \u0441\u043f\u043e\u0441\u043e\u0431 \u0440\u0430\u0437\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 rbenv, \u044f \u0436\u0435 \u043e\u043f\u0438\u0448\u0443 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044e \u0441 rvm \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u043e\u0439 upstart.<\/p>\n<h2>\u0417\u0430\u0434\u0430\u0447\u0438 \u0438 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f<\/h2>\n<p>  \u0418\u0442\u0430\u043a, \u0434\u0430\u043d\u043e: \u043f\u0440\u043e\u0441\u0442\u0435\u0439\u0448\u0435\u0435 RubyOnRails-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435. \u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u0440\u0430\u0437\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u044f \u0441\u0432\u043e\u0435\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u044f \u0441\u0442\u0430\u0432\u0438\u043b \u043f\u0435\u0440\u0435\u0434 \u0441\u043e\u0431\u043e\u0439 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0437\u0430\u0434\u0430\u0447\u0438:  <\/p>\n<ul>\n<li>\u041e\u0421 Ubuntu LTS 14.04;<\/li>\n<li>\u0412\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440 Nginx;<\/li>\n<li>\u0421\u0435\u0440\u0432\u0435\u0440 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f Puma;<\/li>\n<li>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 RVM \u0434\u043b\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 ruby \u0442\u0440\u0435\u0431\u0443\u0435\u043c\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438;<\/li>\n<li>\u0410\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0437\u0430\u043f\u0443\u0441\u043a \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 VPS-\u0441\u0435\u0440\u0432\u0435\u0440\u0430, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u043c \u043a\u0430\u043a \u0441\u043b\u0443\u0436\u0431\u043e\u0439;<\/li>\n<li>\u0410\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u0434\u0435\u043f\u043b\u043e\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e mina;<\/li>\n<\/ul>\n<p>  <b>\u041f\u043e\u0447\u0435\u043c\u0443 Ubuntu?<\/b><br \/>  \u041f\u0440\u043e\u0441\u0442\u043e \u044f \u043a \u043d\u0435\u0439 \u043f\u0440\u0438\u0432\u044b\u043a (\u0442\u043e\u0447\u043d\u0435\u0435 \u043a \u0435\u0451 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u043d\u043e\u0439 \u2014 Linux Mint).<\/p>\n<p>  <b>\u041f\u043e\u0447\u0435\u043c\u0443 puma, \u0430 \u043d\u0435 unicorn \u0438\u043b\u0438 passenger?<\/b><br \/>  \u041e \u043f\u0443\u043c\u0435 \u044f \u0441\u043b\u044b\u0448\u0430\u043b \u043d\u0435\u043f\u043b\u043e\u0445\u0438\u0435 \u043e\u0442\u0437\u044b\u0432\u044b, \u0430 \u0443 unicron \u0441\u0442\u0440\u0430\u0448\u043d\u0435\u043d\u044c\u043a\u0438\u0439 \u0441\u0430\u0439\u0442. Passenger, \u043d\u0430 \u043c\u043e\u0439 \u0432\u0437\u0433\u043b\u044f\u0434, \u043d\u0430\u0440\u0443\u0448\u0430\u0435\u0442 \u043f\u0440\u0438\u043d\u0446\u0438\u043f \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0439 \u043e\u0431\u044f\u0437\u0430\u043d\u043d\u043e\u0441\u0442\u0438 \u2014 \u044f \u0445\u043e\u0447\u0443 \u0438\u043c\u0435\u0442\u044c \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440 \u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435-\u0441\u0435\u0440\u0432\u0435\u0440.<\/p>\n<p>  <b>\u041f\u043e\u0447\u0435\u043c\u0443 RVM?<\/b><br \/>  \u042f \u043a \u043d\u0435\u043c\u0443 \u043f\u0440\u0438\u0432\u044b\u043a \u2014 \u0443 \u043c\u0435\u043d\u044f \u043e\u043d \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d \u043d\u0430 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u0435, \u0445\u043e\u0447\u0443 \u0435\u0433\u043e \u0432\u0438\u0434\u0435\u0442\u044c \u0438 \u043d\u0430 production.<\/p>\n<p>  <b>\u041f\u043e\u0447\u0435\u043c\u0443 mina?<\/b><br \/>  \u041e\u043d\u0430 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0449\u0435 \u0447\u0435\u043c capistrano \u0438 \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0431\u044b\u0441\u0442\u0440\u0435\u0435. \u0421\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0434\u043e\u0441\u0442\u0438\u0433\u0430\u0435\u0442\u0441\u044f \u0437\u0430 \u0441\u0447\u0451\u0442 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438 capistrano \u0441\u043e\u0437\u0434\u0430\u0451\u0442 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0435 ssh-\u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435. Mina \u0436\u0435 \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442 shell-\u0441\u043a\u0440\u0438\u043f\u0442 \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0435\u0433\u043e \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u043e\u0434\u043d\u043e\u0433\u043e \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f.<\/p>\n<p>  \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0437\u0430\u0434\u0430\u0447\u0430 \u043b\u0435\u0433\u043a\u043e \u0440\u0430\u0437\u0431\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0430 3 \u044d\u0442\u0430\u043f\u0430:  <\/p>\n<ol>\n<li>\u0423\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f (\u043f\u043e\u043a\u0430 \u0431\u0435\u0437 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438);<\/li>\n<li>\u041d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0441\u0435\u0440\u0432\u0435\u0440 \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u043d\u0430\u0448\u0435 rails-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u043b\u043e \u043a\u0430\u043a \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u0430\u044f \u0441\u043b\u0443\u0436\u0431\u0430;<\/li>\n<li>\u041d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u044d\u0442\u043e\u0433\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0435 \u0440\u0430\u0437\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e mina.<\/li>\n<\/ol>\n<p>  <a name=\"habracut\"><\/a>  <\/p>\n<h2>\u041f\u0435\u0440\u0432\u044b\u0439 \u0437\u0430\u043f\u0443\u0441\u043a<\/h2>\n<p>  \u041d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u0441\u043e\u0437\u0434\u0430\u043d \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c webapp, \u043e\u0442 \u0438\u043c\u0435\u043d\u0438 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043d\u0430\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435. \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d rvm (\u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f webapp), ruby \u043d\u0443\u0436\u043d\u043e\u0439 \u043d\u0430\u043c \u0432\u0435\u0440\u0441\u0438\u0438, nginx \u0438 \u043f\u0440\u043e\u0447\u0435\u0435. \u0412 Gemfile \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f \u0441\u0442\u0440\u043e\u0447\u043a\u0430:  <\/p>\n<pre><code class=\"ruby\"># ... gem 'puma', group: :production # ... <\/code><\/pre>\n<p>  <b>\u041f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 mina<\/b><\/p>\n<p>  \u0414\u043e\u0431\u0430\u0432\u0438\u043c \u0432 Gemfile \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u0441\u0442\u0440\u043e\u0447\u043a\u0443:  <\/p>\n<pre><code class=\"ruby\">gem 'mina', group: :development <\/code><\/pre>\n<p>  \u0417\u0430\u0442\u0435\u043c \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439:<br \/>  <i>mina init<\/i><\/p>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u043f\u0440\u0438\u0432\u0435\u0434\u0451\u043c \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b config\/deploy.rb \u043a \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c\u0443 \u0432\u0438\u0434\u0443:  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">config\/deploy.rb<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code>require 'mina\/bundler' require 'mina\/rails' require 'mina\/git'  set :domain, 'awesome_address' set :user, 'webapp' set :deploy_to, '\/home\/webapp\/awesome' set :repository, 'https:\/\/github.com\/awesome_user\/awesome.git' set :branch, 'master'  set :shared_paths, ['config\/database.yml', 'config\/secrets.yml', 'config\/puma.rb', 'log']  task :setup =&gt; :environment do   queue! %[mkdir -p &quot;#{deploy_to}\/#{shared_path}\/log&quot;]   queue! %[chmod g+rx,u+rwx &quot;#{deploy_to}\/#{shared_path}\/log&quot;]    queue! %[mkdir -p &quot;#{deploy_to}\/#{shared_path}\/config&quot;]   queue! %[chmod g+rx,u+rwx &quot;#{deploy_to}\/#{shared_path}\/config&quot;]      queue! %[mkdir -p &quot;#{deploy_to}\/#{shared_path}\/puma&quot;]   queue! %[chmod g+rx,u+rwx &quot;#{deploy_to}\/#{shared_path}\/puma&quot;]    queue! %[touch &quot;#{deploy_to}\/#{shared_path}\/config\/database.yml&quot;]   queue! %[touch &quot;#{deploy_to}\/#{shared_path}\/config\/secrets.yml&quot;]   queue! %[touch &quot;#{deploy_to}\/#{shared_path}\/config\/puma.rb&quot;]   queue  %[echo &quot;-----&gt; Be sure to edit '#{deploy_to}\/#{shared_path}\/config\/database.yml', 'secrets.yml' and puma.rb.&quot;] end  desc &quot;Deploys the current version to the server.&quot; task :deploy =&gt; :environment do   deploy do     # Put things that will set up an empty directory into a fully set-up     # instance of your project.     invoke :'git:clone'     invoke :'deploy:link_shared_paths'     invoke :'bundle:install'     #invoke :'rails:db_migrate'     #invoke :'rails:assets_precompile'     #invoke :'deploy:cleanup'   end end <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0444\u0430\u0439\u043b\u0435 \u0437\u0430\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u044b \u0441\u0442\u0440\u043e\u043a\u0438 \u043a\u043e\u0434\u0430, \u043e\u0442\u0432\u0435\u0447\u0430\u044e\u0449\u0438\u0435 \u0437\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0440\u0443\u0442\u0438\u043d\u043d\u044b\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u043f\u043e \u0440\u0430\u0437\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u044e \u043f\u0440\u043e\u0435\u043a\u0442\u0430. \u041f\u043e\u043a\u0430 \u044d\u0442\u0438 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0432\u0440\u0443\u0447\u043d\u0443\u044e.<\/p>\n<p>  \u0422\u0430\u043a\u0436\u0435 \u0445\u043e\u0447\u0443 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u043f\u0440\u0438\u0432\u0435\u0434\u0451\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 mina \u044f \u043d\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u044e \u0432 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c \u0432\u0435\u0440\u0441\u0438\u0439.<\/p>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u043a\u043e\u043c\u0430\u043d\u0434\u0443:<br \/>  <i>mina setup<\/i><\/p>\n<p>  \u0418 \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u0443\u044e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u043f\u0430\u043f\u043e\u043a \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438. \u041f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0434\u0430\u043d\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b \u0432\u044b \u043d\u0435 \u0431\u0443\u0434\u0435\u0442\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u0432 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c \u0432\u0435\u0440\u0441\u0438\u0439, \u0430 \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435. \u041d\u0438\u0436\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0451\u043d \u043f\u0440\u0438\u043c\u0435\u0440 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0439 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0434\u043b\u044f puma.  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">puma.rb<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"ruby\">environment &quot;production&quot;  bind  &quot;unix:\/\/\/home\/webapp\/awesome\/shared\/puma\/puma.sock&quot; pidfile &quot;\/home\/webapp\/awesome\/shared\/puma\/puma.pid&quot; state_path &quot;\/home\/webapp\/awesome\/shared\/puma\/puma.state&quot;  activate_control_app <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0422\u0430\u043a\u0436\u0435 \u044f \u043d\u0430\u0440\u043e\u0447\u043d\u043e \u043d\u0435 \u0445\u0440\u0430\u043d\u044e \u0444\u0430\u0439\u043b puma.rb \u0432 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0435 \u0432\u0435\u0440\u0441\u0438\u0439, \u0442.\u043a. \u0441\u0447\u0438\u0442\u0430\u044e, \u0447\u0442\u043e \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0438\u043d\u0434\u0438\u0432\u0438\u0434\u0443\u0430\u043b\u044c\u043d\u0430 \u043a\u0430\u043a \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<p>  \u0414\u043b\u044f \u0437\u0430\u043c\u0435\u0442\u043a\u0438 \u0436\u0435 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u0444\u0430\u0439\u043b\u0438\u043a config\/puma.sample.rb \u0441 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u043c.<\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0436\u0435 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u00ab\u0440\u0430\u0437\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u0435\u00bb \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f:<br \/>  <i>mina deploy<\/i><\/p>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u043e\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u044b, \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u043f\u043e\u044f\u0432\u0438\u0442\u044c\u0441\u044f \u0441\u0438\u043c\u0432\u043e\u043b\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0441\u0441\u044b\u043b\u043a\u0430 \/home\/webapp\/awesome\/current \u043d\u0430 \u043f\u0430\u043f\u043a\u0443 \u0441 \u043a\u043e\u0434\u043e\u043c \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430.<\/p>\n<p>  <b>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 nginx<\/b><br \/>  \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0444\u0430\u0439\u043b \/etc\/nginx\/sites-available\/awesome \u0441\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u044b\u043c:  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">awesome<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"nginx\">upstream awesome {   server unix:\/\/\/home\/webapp\/awesome\/shared\/puma\/puma.sock; }  server {   listen 80 default_server;   listen [::]:80 default_server ipv6only=on;      root \/home\/webapp\/awesome\/current\/public;      server_name localhost;    location \/ {     proxy_pass http:\/\/awesome;     proxy_set_header Host $host;     proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;   }    location ~* ^\/assets\/ {     # Per RFC2616 - 1 year maximum expiry     expires 1y;     add_header Cache-Control public;      # Some browsers still send conditional-GET requests if there's a     # Last-Modified header or an ETag header even if they haven't     # reached the expiry date sent in the Expires header.     add_header Last-Modified &quot;&quot;;     add_header ETag &quot;&quot;;     break;   } } <\/code><\/pre>\n<\/div>\n<\/div>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0441\u0438\u043c\u0432\u043e\u043b\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u0441\u0441\u044b\u043b\u043a\u0443:<br \/>  <i>cd \/etc\/nginx\/sites-enabled\/<\/i><br \/>  <i>ln -s ..\/sites-available\/awesome awesome<\/i><\/p>\n<p>  \u0418 \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043c nginx:<br \/>  <i>service nginx restart<\/i><\/p>\n<p>  <b>\u0420\u0443\u0447\u043d\u043e\u0439 \u0437\u0430\u043f\u0443\u0441\u043a \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f<\/b><br \/>  \u0422\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u043c \u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u043d\u0430\u0448 \u043f\u0440\u043e\u0435\u043a\u0442.<\/p>\n<p>  \u041f\u043e\u0434\u0433\u043e\u0442\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c:<br \/>  <i>cd \/home\/webapp\/awesome\/current<br \/>  bash &#8212;login<br \/>  rvm use ruby-2.2.1<br \/>  bundle install &#8212;without development:test &#8212;path .\/vendor\/bundle &#8212;deployment<br \/>  RAILS_ENV=production bundle exec rake db:migrate<br \/>  RAILS_ENV=production bundle exec rake assets:precompile<\/i><\/p>\n<p>  \u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c:<br \/>  <i>bundle exec puma -C config\/puma.rb<\/i><\/p>\n<p>  \u041e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442 \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435 \u2014 \u0432\u0441\u0451 \u0434\u043e\u043b\u0436\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c.<\/p>\n<h3>\u041f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043a\u0430\u043a \u0441\u043b\u0443\u0436\u0431\u0430<\/h3>\n<p>  \u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u043b\u043e \u043a\u0430\u043a \u0441\u043b\u0443\u0436\u0431\u0430 \u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u043b\u043e\u0441\u044c \u043f\u0440\u0438 \u0441\u0442\u0430\u0440\u0442\u0435\/\u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u044b, \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c init.d-\u0441\u043a\u0440\u0438\u043f\u0442 \u0438\u043b\u0438 upstart-\u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e.<\/p>\n<p>  \u042f \u0432\u044b\u0431\u0440\u0430\u043b upstart, \u043f\u043e\u0442\u043e\u043c\u0443 \u043a\u0430\u043a \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c\u044b\u0439 \u0444\u0430\u0439\u043b \u0432\u044b\u0445\u043e\u0434\u0438\u0442 \u043d\u0430\u043c\u043d\u043e\u0433\u043e \u043a\u043e\u0440\u043e\u0447\u0435 \u0438 \u043f\u0440\u043e\u0449\u0435 \u0434\u043b\u044f \u0432\u043e\u0441\u043f\u0440\u0438\u044f\u0442\u0438\u044f.<\/p>\n<p>  \u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e \u043f\u043e\u0434\u0440\u0443\u0436\u0438\u0442\u044c upstart \u0438 rvm, <a href=\"https:\/\/rvm.io\/deployment\/init-d\">\u0441\u043e\u0437\u0434\u0430\u0451\u043c \u043e\u0431\u0451\u0442\u043a\u0443<\/a> \u0434\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u0445 \u0444\u0430\u0439\u043b\u043e\u0432 \u043d\u0430\u0448\u0438\u0445 \u0433\u0435\u043c\u043e\u0432:<\/p>\n<p>  <i>rvm alias create awesome ruby-2.2.1@default<\/i><\/p>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u0441\u043e\u0437\u0434\u0430\u0451\u043c upstart-\u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e \/etc\/init\/awesome.conf:  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">awesome.conf<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code>description &quot;Awesome puma service&quot;  # This starts upon bootup and stops on shutdown start on runlevel [2345] stop on runlevel [06]  setuid webapp setgid webapp  respawn respawn limit 3 30  script   cd \/home\/webapp\/awesome\/current   \/home\/webapp\/.rvm\/wrappers\/awesome\/bundle exec puma -C config\/puma.rb end script <\/code><\/pre>\n<\/div>\n<\/div>\n<p>  \u0418 \u0442\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0434\u0435\u043b\u0430\u0442\u044c \u0442\u0430\u043a:<br \/>  <i>start awesome<br \/>  stop awesome<br \/>  restart awesome<br \/>  status awesome<\/i><\/p>\n<h3>\u0418\u0442\u043e\u0433\u043e\u0432\u0430\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u044f<\/h3>\n<p>  \u0422\u0430\u043a \u043a\u0430\u043a \u0434\u0435\u043f\u043b\u043e\u0439 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442\u044c \u043e\u0442 \u0438\u043c\u0435\u043d\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f webapp, \u0430 \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0441\u043b\u0443\u0436\u0431\u044b \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u044b \u043f\u0440\u0430\u0432\u0430 \u0441\u0443\u043f\u0435\u0440\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f, \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0443\u044e \u0441\u0442\u0440\u043e\u0447\u043a\u0443 \u0432 sudoers.<\/p>\n<p>  \u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u043a\u043e\u043c\u0430\u043d\u0434\u0443:<br \/>  <i>visudo<\/i><br \/>  \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c:  <\/p>\n<pre><code>webapp ALL=(ALL) NOPASSWD: \/sbin\/start awesome, \/sbin\/stop awesome, \/sbin\/restart awesome, \/sbin\/status awesome <\/code><\/pre>\n<p>  \u0418 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c.<\/p>\n<p>  <b>\u0418 \u0441\u043d\u043e\u0432\u0430 mina<\/b><br \/>  \u0412 \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 mina \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c mina\/rvm, \u043e\u0434\u043d\u0430\u043a\u043e rvm \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043d\u0430\u043c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043f\u0441\u0435\u0432\u0434\u043e\u043d\u0438\u043c\u044b \u0434\u043b\u044f \u0432\u0435\u0440\u0441\u0438\u0439 ruby \u0438 gemset-\u043e\u0432 \u2014 wrapper-\u044b.<\/p>\n<p>  \u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0438 \u0434\u0435\u043f\u043b\u043e\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u043b\u0441\u044f \u0438\u043c\u0435\u043d\u043d\u043e \u0431\u0430\u043d\u0434\u043b\u0435\u0440 wrappera, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443:  <\/p>\n<pre><code class=\"ruby\">set :bundle_bin, '\/home\/webapp\/.rvm\/wrappers\/awesome\/bundle' <\/code><\/pre>\n<p>  \u0422\u0430\u043a\u0436\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0437\u0430\u0434\u0430\u0447\u0443 \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0430:  <\/p>\n<pre><code class=\"ruby\">desc &quot;Restart the puma web server.&quot; task :restart do   queue 'sudo restart awesome' end <\/code><\/pre>\n<p>  \u0414\u043e\u0431\u0430\u0432\u0438\u0432 \u0432\u0441\u0451 \u044d\u0442\u043e \u0438 \u0440\u0430\u0441\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0432 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0441\u0442\u0440\u043e\u043a\u0438 \u0432 \u0437\u0430\u0434\u0430\u0447\u0435 deploy, \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435:  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">deploy.rb<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"ruby\">require 'mina\/bundler' require 'mina\/rails' require 'mina\/git'  set :domain, 'awesome_address' set :user, 'webapp' set :deploy_to, '\/home\/webapp\/awesome' set :repository, 'https:\/\/github.com\/awesome_user\/awesome.git' set :branch, 'master'  set :bundle_bin, '\/home\/webapp\/.rvm\/wrappers\/awesome\/bundle'  set :shared_paths, ['config\/database.yml', 'config\/secrets.yml', 'config\/puma.rb', 'log']  task :setup =&gt; :environment do   queue! %[mkdir -p &quot;#{deploy_to}\/#{shared_path}\/log&quot;]   queue! %[chmod g+rx,u+rwx &quot;#{deploy_to}\/#{shared_path}\/log&quot;]    queue! %[mkdir -p &quot;#{deploy_to}\/#{shared_path}\/config&quot;]   queue! %[chmod g+rx,u+rwx &quot;#{deploy_to}\/#{shared_path}\/config&quot;]    queue! %[mkdir -p &quot;#{deploy_to}\/#{shared_path}\/puma&quot;]   queue! %[chmod g+rx,u+rwx &quot;#{deploy_to}\/#{shared_path}\/puma&quot;]    queue! %[touch &quot;#{deploy_to}\/#{shared_path}\/config\/database.yml&quot;]   queue! %[touch &quot;#{deploy_to}\/#{shared_path}\/config\/secrets.yml&quot;]   queue! %[touch &quot;#{deploy_to}\/#{shared_path}\/config\/puma.rb&quot;]   queue  %[echo &quot;-----&gt; Be sure to edit '#{deploy_to}\/#{shared_path}\/config\/database.yml', 'secrets.yml' and puma.rb.&quot;] end  desc &quot;Deploys the current version to the server.&quot; task :deploy =&gt; :environment do   deploy do     # Put things that will set up an empty directory into a fully set-up     # instance of your project.     invoke :'git:clone'     invoke :'deploy:link_shared_paths'     invoke :'bundle:install'     invoke :'rails:db_migrate'     invoke :'rails:assets_precompile'     invoke :'deploy:cleanup'     to :launch do       invoke :'restart'     end   end end   desc &quot;Restart the puma web server.&quot; task :restart do   queue 'sudo restart awesome' end <\/code><\/pre>\n<\/div>\n<\/div>\n<p>  <b>\u0412\u0441\u0451 \u0433\u043e\u0442\u043e\u0432\u043e!<\/b><br \/>  \u0422\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u0435\u043c \u0435\u0449\u0451 \u0440\u0430\u0437 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0440\u0430\u0437\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0430 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442:<\/p>\n<p>  <i>mina deploy<\/i><\/p>\n<h2>\u0410\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u044b<\/h2>\n<p>  \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u044b \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c <a href=\"https:\/\/github.com\/puma\/puma\/tree\/master\/tools\/jungle\">puma-jungle<\/a>.<br \/>  \u042d\u0442\u043e \u0448\u0430\u0431\u043b\u043e\u043d\u044b upstart \u0438 init.d \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e \u043e\u0442\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u044e\u0442 \u0441 rbenv, rvm \u0438 \u043f\u0440\u043e\u0447\u0438\u043c\u0438 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440\u0430\u043c\u0438 \u0432\u0435\u0440\u0441\u0438\u0439.<\/p>\n<p>  \u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u0441 rvm \u043d\u0443\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u043b\u0430\u0441\u044c \u0432\u0435\u0440\u0441\u0438\u044f ruby \u0438 gemset, \u0435\u0441\u043b\u0438 \u043e\u043d \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u2014 \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c .ruby-version \u0438 .ruby-gemset \u0444\u0430\u0439\u043b\u044b.<\/p>\n<p>  \u041c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u043e\u0436\u0438\u0442\u044c \u0438\u0445 \u0432 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c \u0432\u0435\u0440\u0441\u0438\u0439, \u0430 \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0434\u0435\u043f\u043b\u043e\u044f \u0447\u0435\u0440\u0435\u0437 mina. \u0422\u0430\u043a\u0436\u0435 \u0432\u0430\u043c \u043f\u0440\u0438\u0434\u0451\u0442\u0441\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 mina\/rvm \u0438 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0437\u0430\u0434\u0430\u0447\u0443 \u0434\u043b\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u0440\u0443\u0431\u0438 \u0438 \u0433\u0435\u043c\u0441\u0435\u0442\u0430.<\/p>\n<p>  \u0412\u0441\u0451 \u0432\u043c\u0435\u0441\u0442\u0435 \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">deploy.rb<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"ruby\"># ...  # Rvm ruby version and gemset rvm = { ruby_version: 'ruby-2.2.1', ruby_gemset: 'default' }  task :environment do   invoke :&quot;rvm:use[#{rvm[:ruby_version]}@#{rvm[:ruby_gemset]}]&quot; end  # ...  desc &quot;Creates appropriate .ruby-version and .ruby-gemset files.&quot; task :'rvm:dot_files' do   queue! %[echo &quot;#{rvm[:ruby_version]}&quot; &gt; .ruby-version]   queue! %[echo &quot;#{rvm[:ruby_gemset]}&quot; &gt; .ruby-gemset] end   task :setup =&gt; :environment do   # ... end  task :deploy =&gt; :environment do   deploy do     invoke :'git:clone'     invoke :'rvm:dot_files'     # ...   end end  # ... <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <\/p>\n<h2>\u041a\u043e\u043d\u0435\u0446<\/h2>\n<p>  \u041d\u0430 \u044d\u0442\u043e\u043c \u043c\u043e\u044f \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u044f \u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f. \u041d\u0430\u0434\u0435\u044e\u0441\u044c, \u0431\u044b\u043b\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u0438 \u043f\u043e\u043b\u0435\u0437\u043d\u043e.             <\/p>\n<div class=\"clear\"><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/265599\/\"> http:\/\/habrahabr.ru\/post\/265599\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<br \/>\n<h2>\u041f\u0440\u0435\u0434\u044b\u0441\u0442\u043e\u0440\u0438\u044f<\/h2>\n<p>  \u041d\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 \u043c\u0435\u043d\u044f \u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0430 \u043d\u0435\u0434\u0430\u0432\u043d\u044f\u044f <a href=\"http:\/\/habrahabr.ru\/post\/265459\/\">\u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u044f \u043e \u0434\u0435\u043f\u043b\u043e\u0435<\/a>. \u0412 \u043f\u0440\u0438\u0432\u0435\u0434\u0451\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043e\u043f\u0438\u0441\u0430\u043d \u0441\u043f\u043e\u0441\u043e\u0431 \u0440\u0430\u0437\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 rbenv, \u044f \u0436\u0435 \u043e\u043f\u0438\u0448\u0443 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044e \u0441 rvm \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u043e\u0439 upstart.<\/p>\n<h2>\u0417\u0430\u0434\u0430\u0447\u0438 \u0438 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f<\/h2>\n<p>  \u0418\u0442\u0430\u043a, \u0434\u0430\u043d\u043e: \u043f\u0440\u043e\u0441\u0442\u0435\u0439\u0448\u0435\u0435 RubyOnRails-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435. \u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u0440\u0430\u0437\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u044f \u0441\u0432\u043e\u0435\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u044f \u0441\u0442\u0430\u0432\u0438\u043b \u043f\u0435\u0440\u0435\u0434 \u0441\u043e\u0431\u043e\u0439 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0437\u0430\u0434\u0430\u0447\u0438:  <\/p>\n<ul>\n<li>\u041e\u0421 Ubuntu LTS 14.04;<\/li>\n<li>\u0412\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440 Nginx;<\/li>\n<li>\u0421\u0435\u0440\u0432\u0435\u0440 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f Puma;<\/li>\n<li>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 RVM \u0434\u043b\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 ruby \u0442\u0440\u0435\u0431\u0443\u0435\u043c\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438;<\/li>\n<li>\u0410\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0437\u0430\u043f\u0443\u0441\u043a \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 VPS-\u0441\u0435\u0440\u0432\u0435\u0440\u0430, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u043c \u043a\u0430\u043a \u0441\u043b\u0443\u0436\u0431\u043e\u0439;<\/li>\n<li>\u0410\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u0434\u0435\u043f\u043b\u043e\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e mina;<\/li>\n<\/ul>\n<p>  <b>\u041f\u043e\u0447\u0435\u043c\u0443 Ubuntu?<\/b><br \/>  \u041f\u0440\u043e\u0441\u0442\u043e \u044f \u043a \u043d\u0435\u0439 \u043f\u0440\u0438\u0432\u044b\u043a (\u0442\u043e\u0447\u043d\u0435\u0435 \u043a \u0435\u0451 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u043d\u043e\u0439 \u2014 Linux Mint).<\/p>\n<p>  <b>\u041f\u043e\u0447\u0435\u043c\u0443 puma, \u0430 \u043d\u0435 unicorn \u0438\u043b\u0438 passenger?<\/b><br \/>  \u041e \u043f\u0443\u043c\u0435 \u044f \u0441\u043b\u044b\u0448\u0430\u043b \u043d\u0435\u043f\u043b\u043e\u0445\u0438\u0435 \u043e\u0442\u0437\u044b\u0432\u044b, \u0430 \u0443 unicron \u0441\u0442\u0440\u0430\u0448\u043d\u0435\u043d\u044c\u043a\u0438\u0439 \u0441\u0430\u0439\u0442. Passenger, \u043d\u0430 \u043c\u043e\u0439 \u0432\u0437\u0433\u043b\u044f\u0434, \u043d\u0430\u0440\u0443\u0448\u0430\u0435\u0442 \u043f\u0440\u0438\u043d\u0446\u0438\u043f \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0439 \u043e\u0431\u044f\u0437\u0430\u043d\u043d\u043e\u0441\u0442\u0438 \u2014 \u044f \u0445\u043e\u0447\u0443 \u0438\u043c\u0435\u0442\u044c \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440 \u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435-\u0441\u0435\u0440\u0432\u0435\u0440.<\/p>\n<p>  <b>\u041f\u043e\u0447\u0435\u043c\u0443 RVM?<\/b><br \/>  \u042f \u043a \u043d\u0435\u043c\u0443 \u043f\u0440\u0438\u0432\u044b\u043a \u2014 \u0443 \u043c\u0435\u043d\u044f \u043e\u043d \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d \u043d\u0430 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u0435, \u0445\u043e\u0447\u0443 \u0435\u0433\u043e \u0432\u0438\u0434\u0435\u0442\u044c \u0438 \u043d\u0430 production.<\/p>\n<p>  <b>\u041f\u043e\u0447\u0435\u043c\u0443 mina?<\/b><br \/>  \u041e\u043d\u0430 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0449\u0435 \u0447\u0435\u043c capistrano \u0438 \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0431\u044b\u0441\u0442\u0440\u0435\u0435. \u0421\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0434\u043e\u0441\u0442\u0438\u0433\u0430\u0435\u0442\u0441\u044f \u0437\u0430 \u0441\u0447\u0451\u0442 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438 capistrano \u0441\u043e\u0437\u0434\u0430\u0451\u0442 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0435 ssh-\u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435. Mina \u0436\u0435 \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442 shell-\u0441\u043a\u0440\u0438\u043f\u0442 \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0435\u0433\u043e \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u043e\u0434\u043d\u043e\u0433\u043e \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f.<\/p>\n<p>  \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0437\u0430\u0434\u0430\u0447\u0430 \u043b\u0435\u0433\u043a\u043e \u0440\u0430\u0437\u0431\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0430 3 \u044d\u0442\u0430\u043f\u0430:  <\/p>\n<ol>\n<li>\u0423\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f (\u043f\u043e\u043a\u0430 \u0431\u0435\u0437 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438);<\/li>\n<li>\u041d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0441\u0435\u0440\u0432\u0435\u0440 \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u043d\u0430\u0448\u0435 rails-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u043b\u043e \u043a\u0430\u043a \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u0430\u044f \u0441\u043b\u0443\u0436\u0431\u0430;<\/li>\n<li>\u041d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u044d\u0442\u043e\u0433\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0435 \u0440\u0430\u0437\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e mina.<\/li>\n<\/ol>\n<p>  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-264468","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/264468","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=264468"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/264468\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=264468"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=264468"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=264468"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}