Rack error on server with each cover: deployment

Every time I start my local cap:deploy machine, I get the following error when opening my web page:

 Ruby (Rack) application could not be started Error message: git://github.com/ctran/annotate_models.git (at master) is not checked out. Please run `bundle install` (Bundler::GitError) Exception class: PhusionPassenger::UnknownError Application root: /vol/www/apps/ror_tutorial/current Backtrace: # File Line Location 0 /usr/local/rvm/gems/ruby-1.9.3-head/gems/bundler-1.0.21/lib/bundler/source.rb 572 in `rescue in load_spec_files' 1 /usr/local/rvm/gems/ruby-1.9.3-head/gems/bundler-1.0.21/lib/bundler/source.rb 570 in `load_spec_files' 2 /usr/local/rvm/gems/ruby-1.9.3-head/gems/bundler-1.0.21/lib/bundler/source.rb 385 in `local_specs' 3 /usr/local/rvm/gems/ruby-1.9.3-head/gems/bundler-1.0.21/lib/bundler/source.rb 555 in `specs' 4 /usr/local/rvm/gems/ruby-1.9.3-head/gems/bundler-1.0.21/lib/bundler/definition.rb 147 in `block in resolve' 5 /usr/local/rvm/gems/ruby-1.9.3-head/gems/bundler-1.0.21/lib/bundler/definition.rb 145 in `each' 6 /usr/local/rvm/gems/ruby-1.9.3-head/gems/bundler-1.0.21/lib/bundler/definition.rb 145 in `resolve' 7 /usr/local/rvm/gems/ruby-1.9.3-head/gems/bundler-1.0.21/lib/bundler/definition.rb 90 in `specs' 8 /usr/local/rvm/gems/ruby-1.9.3-head/gems/bundler-1.0.21/lib/bundler/definition.rb 135 in `specs_for' 9 /usr/local/rvm/gems/ruby-1.9.3-head/gems/bundler-1.0.21/lib/bundler/definition.rb 124 in `requested_specs' 10 /usr/local/rvm/gems/ruby-1.9.3-head/gems/bundler-1.0.21/lib/bundler/environment.rb 23 in `requested_specs' 11 /usr/local/rvm/gems/ruby-1.9.3-head/gems/bundler-1.0.21/lib/bundler/runtime.rb 11 in `setup' 12 /usr/local/rvm/gems/ruby-1.9.3-head/gems/bundler-1.0.21/lib/bundler.rb 110 in `setup' 13 /usr/local/rvm/gems/ruby-1.9.3-head/gems/passenger-3.0.11/lib/phusion_passenger/utils.rb 326 in `prepare_app_process' 14 /usr/local/rvm/gems/ruby-1.9.3-head/gems/passenger-3.0.11/lib/phusion_passenger/rack/application_spawner.rb 156 in `block in initialize_server' 15 /usr/local/rvm/gems/ruby-1.9.3-head/gems/passenger-3.0.11/lib/phusion_passenger/utils.rb 572 in `report_app_init_status' 16 /usr/local/rvm/gems/ruby-1.9.3-head/gems/passenger-3.0.11/lib/phusion_passenger/rack/application_spawner.rb 154 in `initialize_server' 17 /usr/local/rvm/gems/ruby-1.9.3-head/gems/passenger-3.0.11/lib/phusion_passenger/abstract_server.rb 204 in `start_synchronously' 18 /usr/local/rvm/gems/ruby-1.9.3-head/gems/passenger-3.0.11/lib/phusion_passenger/abstract_server.rb 180 in `start' 19 /usr/local/rvm/gems/ruby-1.9.3-head/gems/passenger-3.0.11/lib/phusion_passenger/rack/application_spawner.rb 129 in `start' 20 /usr/local/rvm/gems/ruby-1.9.3-head/gems/passenger-3.0.11/lib/phusion_passenger/spawn_manager.rb 253 in `block (2 levels) in spawn_rack_application' 21 /usr/local/rvm/gems/ruby-1.9.3-head/gems/passenger-3.0.11/lib/phusion_passenger/abstract_server_collection.rb 132 in `lookup_or_add' 22 /usr/local/rvm/gems/ruby-1.9.3-head/gems/passenger-3.0.11/lib/phusion_passenger/spawn_manager.rb 246 in `block in spawn_rack_application' 23 /usr/local/rvm/gems/ruby-1.9.3-head/gems/passenger-3.0.11/lib/phusion_passenger/abstract_server_collection.rb 82 in `block in synchronize' 24 prelude> 10:in `synchronize' 25 /usr/local/rvm/gems/ruby-1.9.3-head/gems/passenger-3.0.11/lib/phusion_passenger/abstract_server_collection.rb 79 in `synchronize' 26 /usr/local/rvm/gems/ruby-1.9.3-head/gems/passenger-3.0.11/lib/phusion_passenger/spawn_manager.rb 244 in `spawn_rack_application' 27 /usr/local/rvm/gems/ruby-1.9.3-head/gems/passenger-3.0.11/lib/phusion_passenger/spawn_manager.rb 137 in `spawn_application' 28 /usr/local/rvm/gems/ruby-1.9.3-head/gems/passenger-3.0.11/lib/phusion_passenger/spawn_manager.rb 275 in `handle_spawn_application' 29 /usr/local/rvm/gems/ruby-1.9.3-head/gems/passenger-3.0.11/lib/phusion_passenger/abstract_server.rb 357 in `server_main_loop' 30 /usr/local/rvm/gems/ruby-1.9.3-head/gems/passenger-3.0.11/lib/phusion_passenger/abstract_server.rb 206 in `start_synchronously' 31 /usr/local/rvm/gems/ruby-1.9.3-head/gems/passenger-3.0.11/helper-scripts/passenger-spawn-server 99 in `' 

I will fix this with the following lines:

 $ bundle install --without development test $ bundle install --deployment $ service nginx restart 

But I'm really tired of doing it all over again. Does anyone know how to fix this forever?

My gemfile:

 source 'http://rubygems.org' gem 'rails', '3.1.3' gem 'gravatar_image_tag' gem 'will_paginate' gem 'rack' gem 'rake' gem 'texticle', "2.0", :require => 'texticle/rails' # Gems used only for assets and not required # in production environments by default. group :assets do gem 'sass-rails' gem 'coffee-rails' gem 'uglifier' end gem 'jquery-rails' group :development do gem 'capistrano' gem 'rspec-rails' gem 'therubyracer-heroku' gem 'pg' gem 'annotate', :git => 'git://github.com/ctran/annotate_models.git' gem 'faker' end group :test do gem 'rspec-rails' gem 'webrat' gem 'spork' gem 'autotest' gem 'autotest-rails-pure' gem 'autotest-fsevent' gem 'autotest-growl' gem 'factory_girl_rails' end group :production do gem 'pg' gem 'faker' end 

configuration / deploy.rb

 set :user, "root" set :rails_env, "production" default_run_options[:pty] = true set :repository, "git://github.com/Loremaster/sample_app.git" set :application, "ror_tutorial" set :deploy_to, "/vol/www/apps/#{application}" set :scm, :git set :branch, "master" set :deploy_via, :remote_cache server "my.ip", :app, :web, :db, :primary => true # If you are using Passenger mod_rails uncomment this: namespace :deploy do task :start do ; end task :stop do ; end task :restart, :roles => :app, :except => { :no_release => true } do run "#{try_sudo} touch #{File.join(current_path,'tmp','restart.txt')}" end end 

My Server System:

 Ubuntu 10.04 LTS PostgreSQL 9.1 Rails 3.1.3 Ruby 1.9.3p27 Nginx 1.0.11 (installed/compiled by passenger) Phusion passenger 3.0.11 Capistrano 
+4
source share
2 answers

capistrano does not automatically run the bundler command unless you specify that you are using bundler in your deploy.rb. I am adding this line to the top of my deploy.rb file to enable package integration. Capistrano then automatically runs the correct sender commands upon deployment.

 require 'bundler/capistrano' # Add Bundler integration to capistrano 

Your solution running bundle install --without development test and bundle install --deployment is virtually the same, but needs to be updated manually. In addition, you can translate it into one command: bundle install --deployment --without development test . In your current solution, you run the package twice.

+7
source

I had the same problem. Of our 5 environments, our intermediate environment began to do this in blue. I was not able to find out the reason, but I was finally able to deploy by backing up and then re-creating our deployment directory, then launch the deployment: setup, cap deploy: cold then cap deploy

0
source

Source: https://habr.com/ru/post/1392731/


All Articles