Category: Capistrano

Rails, Capistrano, Database.yml

I’ve found the easiest way to manage the config/database.yml file in a Rails + Capistrano configuration is to add the following line to your capistrano config/deploy.rb configuration file: set :linked_files, %w{config/database.yml} Then add config/database.yml to your .gitignore file. After which, add your environment’s database.yml file to the appropriate location on the remote server(s): #{deploy_to}/appname/shared/config/database.yml Where […]

Capistrano, Rbenv, bundle: command not found

After running cap production deploy:restart   Our remote Puma log would show the following: -su: bundle: command not found   However, this was an active production server, so the bundler gem existed. After logging in and attempting to run a simple command, such as: bundle exec rails console   The console would output the following: […]

Capistrano, rbenv, upstart, and -su: bundle: command not found

If you’re running into the following error attempting to deploy via Capistrano with rbenv, foreman, and upstart: -su: bundle: command not found Then, be sure to take the export and eval rbenv statements in your ~/.bashrc file and copy them to the bottom of your ~/.profile export PATH=”$HOME/.rbenv/bin:$PATH” eval “$(rbenv init -)”   As this […]

Rails Capistrano deployment: SSH, Error reading response length from authentication socket

If you’re running a rails application with capistrano and you run into the following error: Error reading response length from authentication socket When you attempt to connect via cap, for instance > cap staging deploy Then make sure you can answer the following questions with a ‘yes’ before continuing. 1) Is my private key properly […]