W
W
wal0vari2015-01-31 21:55:27
Ruby on Rails
wal0vari, 2015-01-31 21:55:27

I can't set up capistrano, what am I doing wrong?

Configured gem capistrano following this instruction
Stops at moment
Command: ( GIT_ASKPASS=/bin/echo GIT_SSH=/tmp/"project name"/git-ssh.sh /usr/bin/env git ls-remote [email protected]:git )
Keys added, everything is tightened by hand.
Help!!!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vasily Shakhunov, 2015-02-02
@wal0vari

The instruction looks like it contains a lot of unnecessary nonsense. I recommend reading with Capistrano Setup .
At a minimum, to install capistrano you need:

  1. Understand what tools are needed for deployment: rvm, bower, etc ...
  2. Add everything you need to Gemfile
    # Use Capistrano for deployment
    group :development do
      gem 'capistrano'
      gem 'capistrano-rails'
      gem 'capistrano-bundler'
      gem 'capistrano-rvm'
      gem 'capistrano-passenger'
      gem 'capistrano-bower'
    end
  3. Uninstall applicationbundle exec cap install
  4. Require all these modules in Capfile
    require 'capistrano/rvm'
    require 'capistrano/bundler'
    require 'capistrano/rails'
    require 'capistrano/bower'
    require 'capistrano/passenger'

  5. Populate minimalist config/deploy.rb
    # config valid only for current version of Capistrano
    lock '3.3.5'
    
    set :application, 'my_awesome_site'
    set :repo_url, '[email protected]:username/my_awesome_site.git'
    
    # Default deploy_to directory is /var/www/my_app_name
    set :deploy_to, "/home/user/www/#{fetch(:application)}"
    
    # Default value for :scm is :git
    set :scm, :git

  6. Set deployment environment specific options in config/deploy/production.rb
    role :app, %w{myhosting.ru}
    role :web, %w{myhosting.ru}
    role :db,  %w{myhosting.ru}
    
    
    # Extended Server Syntax
    # ======================
    # This can be used to drop a more detailed server definition into the
    # server list. The second argument is a, or duck-types, Hash and is
    # used to set extended properties on the server.
    
    server 'myhosting.ru', user: 'user', roles: %w{web app db}
    set :rails_env, 'production'
    
    set :rvm_type, :user                     # Defaults to: :auto
    set :rvm_ruby_version, '[email protected]'      # Defaults to: 'default'

  7. Everything. Then do it bundle exec cap production deploy:checkand do it for a long time bundle exec cap production deploycatching deployment errors and fixing them :)

V
Viktor Vsk, 2015-01-31
@viktorvsk

Unfortunately, capistrano is not something that can be debugged remotely in psychic fashion.
I would advise only to break the task into steps and arm yourself with debugging.
maybe the deployer user needs sudo, maybe he doesn't have the keys, you can't just say that.
Capistrano doesn't have the best debug messages.
See which user is deploying. What are his rights. Which commands are executed and which are not. Look at all the logs you can find. Try to transfer the sources to bitbucket for the sake of testing.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question