Package installation error while deploying Rails 3 application in Dreamhost with Capistrano

I am trying to deploy a locally running Rails 3 application for Dreamhost with Capistrano. When I run โ€œcap deploy -vโ€ in my local root application, I still choke on this โ€œinstall packageโ€. The following is the error message:

** transaction: start ** [abunchofletters.co.uk :: out] my_username@abunchofletters.co.uk password: Password: ** [abunchofletters.co.uk :: out] ** [abunchofletters.co.uk :: out] HEAD is now at 62f9cdb. Initial deployment to Dreamhost ** [out :: abunchofletters.co.uk] sh: bundle: command not found * [deploy: update_code] rollback failed: "sh -c" bundle install --gemfile / home / my_username / abunchofletters.co .uk / releases / 20110111100145 / Gemfile --path / home / my_username / abunchofletters.co.uk / shared / bundle --deployment - quiet - no development test "on abunchofletters.co.uk

However, when I find SSH on my server and check the list of gems, it shows that bundler 1.0.7 is installed [Ruby 1.8.7, Rails 3.0.3, RubyGems 1.3.6 also work]. This is my first experience deploying a Rails application as well as Capistrano, so I'm close to ignorant, but I would assume that some path or variable is set incorrectly.

Here's my deploy.rb [created from the following http://railstips.org/blog/archives/2008/12/14/deploying-rails-on-dreamhost-with-passenger/ , so it might be deprecated]:

require "bundler/capistrano" # http://gembundler.com/deploying.html default_run_options[:pty] = true # be sure to change these set :user, 'my_username' set :domain, 'abunchofletters.co.uk' set :application, 'abunchofletters' # the rest should be good set :repository, "#{user}@#{domain}:git/#{application}.git" set :deploy_to, "/home/#{user}/#{domain}" set :deploy_via, :remote_cache set :scm, 'git' set :branch, 'master' set :git_shallow_clone, 1 set :scm_verbose, true set :use_sudo, false server domain, :app, :web role :db, domain, :primary => true namespace :deploy do task :restart do run "touch #{current_path}/tmp/restart.txt" end end 

Any ideas on how to move forward? If you need more information, you just need to tell me, and I will put it.

+3
ruby-on-rails-3 deployment dreamhost bundler capistrano
source share
1 answer

I am not very happy with the solution I came up with, but it got a deployment for work and a collector for update.

Here is my updated deploy.rb:

 #require "bundler/capistrano" default_run_options[:pty] = true # be sure to change these set :user, 'futureproof' set :domain, 'abunchofletters.co.uk' set :application, 'abunchofletters' # the rest should be good set :repository, "#{user}@#{domain}:git/#{application}.git" set :deploy_to, "/home/#{user}/#{domain}" set :deploy_via, :remote_cache set :shared_path, "/home/#{user}/.gems" set :scm, 'git' set :branch, 'master' set :git_shallow_clone, 1 set :scm_verbose, true set :use_sudo, false server domain, :app, :web role :db, domain, :primary => true namespace :deploy do desc "expand the gems" task :gems, :roles => :web, :except => { :no_release => true } do run "cd #{current_path}; #{shared_path}/bin/bundle unlock" run "cd #{current_path}; nice -19 #{shared_path}/bin/bundle install vendor/" # nice -19 is very important otherwise DH will kill the process! run "cd #{current_path}; #{shared_path}/bin/bundle lock" end task :restart do run "touch #{current_path}/tmp/restart.txt" end end 

Task: gems was visible here: http://grigio.org/deploy_rails_3_passenger_apache_dreamhost , although blocking / unblocking packages is now deprecated. I may be able to simply replace with installing / updating the package, but the obsolete one will do today.

0
source share

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


All Articles