Questions tagged [capistrano]

Capistrano is a developer tool for deploying web applications. It is typically installed on a workstation, and used to deploy code from your source code management (SCM) to one, or more servers.

Capistrano is an open source tool for running scripts on multiple servers; its main use is deploying web applications. It automates the process of making a new version of an application available on one or more web servers, including supporting tasks such as running database migrations.

Capistrano is written in the Ruby language and is distributed using the RubyGems distribution channel. It is an outgrowth of the Ruby on Rails web application framework, but has also been used to deploy web applications written using other frameworks, including ones written in PHP.

Capistrano is implemented primarily for use on the bash command line. Users of the Ruby on Rails framework may choose from many Capistrano recipes; e.g. to deploy current changes to the web application or roll back to the previous deployment state.

Originally called SwitchTower, the name was changed to Capistrano in March 2006 because of a trademark conflict.

Resources:

Related tags:

Implementation specific tags

When you are asking a question about capistrano you could also add more specific tags. Here is the list of available tags:

Online Screencasts

  1. Codeschool Deployment: Capistrano - Part 1
  2. Codeschool Deployment: Capistrano - Part 2
  3. Railscasts Capistrano Tasks - Do you know how to make Capistrano tasks? See how to change default deployment behavior with custom tasks in this episode.
  4. Capistrano Tasks (revised) - Learn the basics of writing Capistrano tasks, how to set variables, and run commands on a remote server
3868 questions
24
votes
5 answers

Capistrano Error - Net::SSH::HostKeyMismatch

I'm completely new to Capistrano and to Ruby, and I can't seem to get basic deployment set up. Every time I run cap deploy:check I get the following error: servers: ["domain.com"] connection failed for: me@domain.com (Net::SSH::HostKeyMismatch:…
jg314
  • 586
  • 1
  • 6
  • 15
24
votes
2 answers

Running and Deploying Rails to Docker Container

I am a total noob to linux containers and been spending some time learning about Docker, and forgive my confusion thought this question. Currently, I have a Rails app in production deployed via capistrano. My cloud servers are maintained with…
Jahkobi Digital
  • 728
  • 11
  • 24
23
votes
9 answers

How to enter rails console on production via capistrano?

I want to enter the rails console on production server from my local machine via capistrano. I found some gists, e.g. https://gist.github.com/813291 and when I enter console via cap production console I get the following…
monavari-lebrecht
  • 900
  • 3
  • 9
  • 23
23
votes
10 answers

Capistrano deployment error in rails application

I am getting this error on doing cap production deploy in my rails application my net-ssh version is 5.0.2 can anyone please help me how i can fix this. My server is…
puja garg
  • 363
  • 1
  • 4
  • 9
23
votes
2 answers

How to modify capistrano deploy to automatically run migrations in Rails 3.0

Right now, I have to run cap deploy and cap deploy:migrations if there are migrations to be run. how I modify the cap deploy task to run migrations.
Amal Kumar S
  • 15,555
  • 19
  • 56
  • 88
23
votes
4 answers

db:schema:load vs db:migrate with capistrano

I have a rails app that I'm moving to another server and I figure I should use db:schema:load to create the mysql database because it's recommended. My problem is that I'm using capistrano to deploy and it seems to be defaulting to rake db:migrate…
Anon
  • 5,103
  • 11
  • 45
  • 58
22
votes
3 answers

database.yml deployment best practice

I don't check my database.yml file into source control and I was wondering what others do/best practice for copying this file over to the server when deploying. I use Capistrano for deployment.
robzolkos
  • 2,196
  • 3
  • 30
  • 47
22
votes
3 answers

Python3 __pycache__ generating even if PYTHONDONTWRITEBYTECODE=1

I would like to ask if there is another way to disable creation of __pycache__ in the server. My problem is it keeps generating even if I already set environment variable to PYTHONDONTWRITEBYTECODE=1 I want to disable __pycache__ because I only…
anne
  • 611
  • 2
  • 6
  • 11
21
votes
2 answers

No such file or directory in capistrano deploy

Here is the error when doing cap deploy: *** [err :: 11.15.19.46] find: `/var/www/emclab/releases/20111208184942/public/images' *** [err :: 11.15.19.46] : No such file or directory *** [err :: 11.15.19.46] find:…
user938363
  • 9,990
  • 38
  • 137
  • 303
21
votes
3 answers

Problems deploying code with Capistrano since upgrading to macOS 10.12 (Sierra), “Permission denied (publickey).”

So I just upgraded my Mac mini (Late 2012) to macOS 10.12 (Sierra) and everything seems fine, but I’m running into one odd problem deploying code with Capistrano. I get the following error: Permission denied (publickey). Never had this problem…
Giacomo1968
  • 25,759
  • 11
  • 71
  • 103
21
votes
3 answers

Capistrano mkdir permission denied

When I run cap production deploy I get cannot create directory ‘/var/www/application/repo’: Permission denied. So far I've created deploy user like: adduser deploy adduser deploy sudo and I use this user in Capistrano. Indeed, when I log to…
Kamil Lelonek
  • 14,592
  • 14
  • 66
  • 90
21
votes
2 answers

rails4 - Psych::BadAlias: Unknown alias: test

trying to deploy my project using Capistrano cap deploy:migrate , I get an error in my database.yml on the test alias ( which is just running fine on local server) development: database: db_dev adapter: mysql2 username: xxxxxx password:…
user762579
21
votes
3 answers

Is there a way to deploy into a vagrant VM using Capistrano?

I'd like to setup a vagrant instance outside of my project directory. Is there a way to deploy rails into the vagrant VM with capistrano as I would to my real production host? I'm trying to use server as "localhost" but I get: connection failed…
Nathan
  • 7,627
  • 11
  • 46
  • 80
20
votes
1 answer

RVM Gemset - Bundler & Capistrano in Production

I'm deploying a rails app to a VPS with capistrano, bundler and rvm. Here is part of my deploy.rb $:.unshift(File.expand_path('./lib', ENV['rvm_path'])) require "rvm/capistrano" require "bundler/capistrano" # Load RVM's capistrano…
Jazmin
  • 271
  • 2
  • 6
20
votes
4 answers

Capistrano fail to deploy rails app due to incompatibility with OpenSSL 3.0

I have a rails application with Rails 7 and Ruby 3 support, which is working well in my development machine with Ubuntu 22.04, ruby 3.0.2p107 and Rails 7.0.2.3. Now I'm trying to set up Capistrano (version 3.17.0) in order to deploy the rails app to…
Aldo
  • 704
  • 6
  • 7