• Stars
    star
    201
  • Rank 194,491 (Top 4 %)
  • Language
    Ruby
  • License
    MIT License
  • Created over 11 years ago
  • Updated over 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Idiomatic rbenv support for Capistrano 3.x

Capistrano::rbenv

This gem provides idiomatic rbenv support for Capistrano 3.x (and 3.x only).

Please Note

If you want to use this plugin with Cap 2.x, please use 1.x version of the gem. Source code and docs for older integration is available in another repo

Thanks a lot to @yyuu for merging his gem with official one.

Installation

Add this line to your application's Gemfile:

gem 'capistrano', '~> 3.9'
gem 'capistrano-rbenv', '~> 2.2'

And then execute:

$ bundle install

Usage

# Capfile
require 'capistrano/rbenv'


# config/deploy.rb
set :rbenv_type, :user # or :system, or :fullstaq (for Fullstaq Ruby), depends on your rbenv setup
set :rbenv_ruby, '2.4.2'

# in case you want to set ruby version from the file:
# set :rbenv_ruby, File.read('.ruby-version').strip

set :rbenv_prefix, "RBENV_ROOT=#{fetch(:rbenv_path)} RBENV_VERSION=#{fetch(:rbenv_ruby)} #{fetch(:rbenv_path)}/bin/rbenv exec"
set :rbenv_map_bins, %w{rake gem bundle ruby rails}
set :rbenv_roles, :all # default value

If your rbenv is located in some custom path, you can use rbenv_custom_path to set it.

Defining the ruby version

To set the Ruby version explicitly, add :rbenv_ruby to your Capistrano configuration:

# config/deploy.rb
set :rbenv_ruby, '2.4.2'

Alternatively, allow the remote host's rbenv to determine the appropriate Ruby version by omitting :rbenv_ruby. This approach is useful if you have a .ruby-version file in your project.

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

More Repositories

1

capistrano

A deployment automation tool built on Ruby, Rake, and SSH.
Ruby
12,665
star
2

sshkit

A toolkit for deploying code and assets to servers in a repeatable, testable, reliable way.
Ruby
1,135
star
3

rails

Official Ruby on Rails specific tasks for Capistrano
Ruby
865
star
4

symfony

Capistrano tasks for deploying the Symfony standard edition
Ruby
354
star
5

laravel

Gem for deploying Laravel projects with capistrano v3.*
Ruby
222
star
6

bundler

Bundler support for Capistrano 3.x
Ruby
219
star
7

composer

Capistrano extension for Composer tasks
Ruby
183
star
8

npm

Capistrano extension for npm
Ruby
157
star
9

maintenance

Maintenance Page Support For Capistrano
Ruby
153
star
10

rvm

Ruby
140
star
11

passenger

Passenger support for Capistrano 3.x
Ruby
138
star
12

notification-center

Capistrano integration with macOS Notification Center
Ruby
88
star
13

documentation

CSS
81
star
14

file-permissions

File permissions handling for Capistrano v3.*
Ruby
46
star
15

drupal-deploy

Gem for deploying Drupal projects with capistrano 3
Ruby
40
star
16

github

Ruby
26
star
17

capistrano-2.x-docs

An archive of the now-defunct Capistrano 2.x wiki
24
star
18

copy-files

Capistrano v3.* extension for copying files between releases
Ruby
23
star
19

chruby

Ruby
23
star
20

stats

Capistrano statistics, gem, server, manifest and dashboard
Go
12
star
21

packer

Packer manifest to build a debian image for Vagrant which we can use to test against. (and, also for inducting people to the Capistrano way)
Shell
6
star
22

danger

Common Dangerfile for Capistrano projects
Ruby
3
star
23

capistrano-features

A place for discussions about possible Capistrano developments.
2
star
24

capistrano-sprockets

Rails Sprocket Support For Capistrano
2
star