{"id":13818284,"url":"https://github.com/rvm/rvm-capistrano","last_synced_at":"2025-10-28T16:45:55.476Z","repository":{"id":2831481,"uuid":"3834145","full_name":"rvm/rvm-capistrano","owner":"rvm","description":"RVM / Capistrano Integration Gem","archived":false,"fork":false,"pushed_at":"2016-09-16T19:07:17.000Z","size":152,"stargazers_count":200,"open_issues_count":4,"forks_count":39,"subscribers_count":25,"default_branch":"master","last_synced_at":"2025-10-25T16:55:02.503Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rvm.png","metadata":{"files":{"readme":"README.md","changelog":"History.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-03-26T15:19:12.000Z","updated_at":"2025-03-23T17:53:13.000Z","dependencies_parsed_at":"2022-08-21T01:20:20.343Z","dependency_job_id":null,"html_url":"https://github.com/rvm/rvm-capistrano","commit_stats":null,"previous_names":["wayneeseguin/rvm-capistrano"],"tags_count":49,"template":false,"template_full_name":null,"purl":"pkg:github/rvm/rvm-capistrano","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rvm%2Frvm-capistrano","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rvm%2Frvm-capistrano/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rvm%2Frvm-capistrano/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rvm%2Frvm-capistrano/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rvm","download_url":"https://codeload.github.com/rvm/rvm-capistrano/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rvm%2Frvm-capistrano/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281476640,"owners_count":26508143,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-28T02:00:06.022Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-04T07:00:39.839Z","updated_at":"2025-10-28T16:45:55.453Z","avatar_url":"https://github.com/rvm.png","language":"Ruby","funding_links":[],"categories":["Awesome Capistrano"],"sub_categories":["Gems"],"readme":"# rvm-capistrano\n\n## Description\n\nRVM / Capistrano Integration Gem\n\n## Compatibility\n\n- `rvm-capistrano` `1.3.0` with Autolibs requires at least RVM `1.19.0`.\n- `capistrano` `3.0.0` is a rewrite and does not work with this gem, use [`rvm1/capistrano3`](https://github.com/rvm/rvm1-capistrano3#readme) it will be extended to match this gem functionality.\n\n## Installation\n\nRVM / Capistrano integration is available as a separate gem\n\n```bash\n$ gem install rvm-capistrano\n```\n\nOr, if the **capistrano** gem is already in your `Gemfile`, then add **rvm-capistrano**:\n\n```bash\n$ echo \"gem 'rvm-capistrano'\" \u003e\u003e Gemfile\n$ bundle install\n```\n\n## Modules\n\nSince version `1.4.0` `rvm-capistrano` is divided into separate\nmodules which allow selecting which parts of it should be included.\n\n`rvm/capistrano`:\n\n- `base`     - minimal code, does not change behaviors, only provides definitions like `:rvm_shell`\n- `selector` - extends `base` to automatically `set :default_shell`\n- `selector_mixed` - alternative version of `selector` allowing to select which servers should be RVM aware\n- `info_list`      - adds tasks `rvm:info`, `rvm:list` and `rvm:info_list`\n- `install_rvm`    - adds task `rvm:install_rvm` - it also updates rvm if already installed\n- `install_ruby`   - adds task `rvm:install_ruby`\n- `create_gemset`  - adds task `rvm:create_gemset`\n- `empty_gemset`   - adds task `rvm:empty_gemset`\n- `install_pkgs`   - adds task `rvm:install_pkgs` - **deprecated** (you should try `autolibs` first)\n- `gem_install_uninstall` - adds tasks `rvm:install_gem`   / `rvm:uninstall_gem`\n- `gemset_import_export`  - adds tasks `rvm:import_gemset` / `rvm:export_gemset`\n- `alias_and_wrapp`       - adds tasks `rvm:create_alias`  / `rvm:create_wrappers` / `rvm:show_alias_path`\n\nBy default `rvm/capistrano` loads: `selector`, `info_list`, `install_rvm`, `install_ruby`, `create_gemset`.\n\nWarning: `selector` and `selector_mixed` are to be used separately they can not be used both at the same time.\n\n## Requiring\n\nMinimal code to load this gem is:\n\n```ruby\nrequire \"rvm/capistrano\"\n```\n\nUsually it's placed in `config/deploy.rb`.\n\n## Example\n\nThe following code will:\n\n- detect `ruby@gemset` used for deployment\n- install RVM and Ruby on `cap deploy:setup`\n\nExample:\n\n```ruby\nrequire \"rvm/capistrano\"\n\nset :rvm_ruby_string, :local              # use the same ruby as used locally for deployment\nset :rvm_autolibs_flag, \"read-only\"       # more info: rvm help autolibs\n\nbefore 'deploy:setup', 'rvm:install_rvm'  # install/update RVM\nbefore 'deploy:setup', 'rvm:install_ruby' # install Ruby and create gemset, OR:\n# before 'deploy:setup', 'rvm:create_gemset' # only create gemset\n```\n\n### Disabling `bundle --deployment` when using gemsets\n\nUsing gemsets is safer from `bundle --deployment` which is default, to disable it use:\n\n```ruby\nset :bundle_dir, ''\nset :bundle_flags, '--system --quiet'\n```\n\n### RVM + Ruby on every deploy\n\nUpdate RVM and make sure Ruby is installed on every deploy:\n\n```ruby\nrequire \"rvm/capistrano\"\n\nset :rvm_ruby_string, :local        # use the same ruby as used locally for deployment\n\nbefore 'deploy', 'rvm:install_rvm'  # install/update RVM\nbefore 'deploy', 'rvm:install_ruby' # install Ruby and create gemset (both if missing)\n```\n\n### Create application alias and wrappers\n\nFor server scripts and configuration the easiest is to use wrappers from aliased path.\n\n```ruby\nrequire \"rvm/capistrano/alias_and_wrapp\"\nbefore 'deploy', 'rvm:create_alias'\nbefore 'deploy', 'rvm:create_wrappers'\n```\nTo see the path to be used in scripts use:\n```bash\ncap rvm:show_alias_path\n```\nIt will show either that the path does not exist yet:\n```ruby\n*** [err :: niczsoft.com] ls: cannot access /home/ad/.rvm//wrappers/ad/*: No such file or directory\n```\nor in case it exist it will list all available wrappers:\n```\n...\n ** [out :: niczsoft.com] /home/ad/.rvm//wrappers/ad/ruby\n...\n```\nThis will allow to use clean scripts where proper RVM settings are automatically loaded\nfrom the aliased wrappers. For example configuring\n[PassengerRuby](http://www.modrails.com/documentation/Users%20guide%20Apache.html#PassengerRuby)\nwith `/home/ad/.rvm//wrappers/ad/ruby`, this way there is no need for changing scripts\nwhen the application ruby changes. In the same spirit you can use wrapper for `bundle`\nin **cron** or **init.d** scripts with `/home/ad/.rvm//wrappers/ad/bundle exec [command]` -\nit will automatically load proper configuration for the application, no need for any tricks.\n\n### To use the ruby version currently active locally\n\n```ruby\nset :rvm_ruby_string, :local\n```\n\n### To restrict rvm to only `:app` servers\n\nWarning, when using `:rvm_require_role` `parallel` is used to select shell per server instead of `:default_shell`\n\n```ruby\nset :rvm_require_role, :app\nrequire \"rvm/capistrano/selector_mixed\"\n```\n\nIt is important to `set :rvm_require_role` before `require \"rvm/capistrano/selector_mixed\"`.\n\n### To restrict rvm to only some servers\n\n```ruby\nset :rvm_require_role, :rvm\nrequire \"rvm/capistrano/selector_mixed\"\nrole :rvm, \"web1\", \"web2\"\nrole :app, \"web1\", \"web2\", \"web3\"\n```\n\n### To control rvm shell manually\n\n```ruby\nrequire \"rvm/capistrano/base\"\nset :default_shell, :bash\ntask :example do\n  run \"echo 'in rvm'\", :shell =\u003e fetch(:rvm_shell)\nend\n```\n\n### Disable rvm shell for single command\n\n```ruby\ntask :example do\n  run \"echo 'not in rvm'\", :shell =\u003e :bash\nend\n```\n\n### Show info on remote rvm and list rubies\n\n```bash\ncap rvm:info_list\n```\n\n## Options\n\n- `:rvm_ruby_string` - which ruby should be loaded\n - `release_path` - load ruby defined in `#{release_path}` - Capistrano variable pointing where code is checked out\n - `latest_release` - load ruby defined in `#{release_path}`, if it exists, or `#{current_path}`\n - `local` - detect local machine running ruby using `GEM_HOME`\n - `\u003cruby-version\u003e` - specify ruby version to use\n\n- `:rvm_type` - how to detect rvm, default `:user`\n - `:user` - RVM installed in `$HOME`, user installation (default)\n - `:system` - RVM installed in `/usr/local`, multiuser installation\n - (some other values permitted for backwards compatability only)\n\n- `:rvm_user` - arguments to pass to `rvm user`, to enable mixed mode (e.g. system rubies and user gemsets).  Based on whether rvm_user includes :gemsets it also helps determine the correct path for importing/exporting gemsets, and similarly, whether to use sudo for gemset creation/deletion and other operations.\n- `:rvm_autolibs_flag` - control autolibs, read more `rvm help autolibs`\n - `:disable` - fully disable autolibs, limit automated tasks\n - `:read`    - autolibs only in read only mode, do not change anything in system\n - `:fail`    - autolibs only in read only mode, fail if changes are required\n - `:enable`  - let RVM install what is needed for ruby, required `set :use_sudo, true`\n\n- `:rvm_path` - force `$rvm_path`, only overwrite if standard paths can not be used\n- `:rvm_bin_path` - force `$rvm_bin_path`, only overwrite if standard paths can not be used\n- `:rvm_gemset_path` - storage for gem lists files for exporting/importing, by default `$rvm_path/gemsets`\n- `:rvm_install_with_sudo` - when set to `true` forces RVM installation with `sudo` even `:use_sudo` is set to `false`\n\n- `:rvm_install_type` - version of RVM to install, by default `stable`\n - `stable` - stable version of RVM\n - `head` - head version of RVM (development)\n - `latest-1.18` - latest version of RVM 1.18.x\n - `1.18.4` - selected version\n\n- `:rvm_install_shell` - shell to be used for `rvm` operations, by default `bash`, most likely you do not need to change it\n- `:rvm_install_ruby` - a command used to install ruby, by default `install`, most likely you do not need to change it\n- `:rvm_install_ruby_threads` - number of threads to use for ruby compilation, rvm by default uses all CPU cores\n- `:rvm_install_ruby_params` - parameters for ruby, example `--patch railsexpress`\n- `:rvm_install_pkgs` - array of packages to install with `cap rvm:install_pkgs`\n- `:rvm_add_to_group` - user name to add to `rvm` group when RVM is installed with `:rvm_type` `:system`, by default it's the user name that runs deploy\n\n- `:rvm_require_role` - allows using RVM for only one role, useful when database is separated, it has to be defined before `require 'rvm/capistrano'`\n - `:app` - use RVM only on servers defined for role `:app`\n - `:rvm` - use RVM only on servers defined for role `:rvm` - where not all `:app` servers support RVM\n - `\u003crole\u003e` - any other role that is defining servers supporting RVM\n\n## Tasks\n\n```bash\n$ cap -T rvm\ncap rvm:create_gemset        # Create gemset\ncap rvm:export_gemset        # Export the current RVM ruby gemset contents to a file.\ncap rvm:import_gemset        # Import file contents to the current RVM ruby gemset.\ncap rvm:info                 # Show rvm info\ncap rvm:info_list            # Show info and list rubies\ncap rvm:list                 # List rvm rubies\ncap rvm:install_ruby         # Install RVM ruby to the server, create gemset ...\ncap rvm:install_rvm          # Install/update RVM of the given choice to the server.\ncap rvm:install_pkgs         # Install RVM packages to the server.\ncap rvm:install_gem   GEM=my_gem  # Install gem {my_gem} on the server using selected ruby.\n                                  # Use `ENV['GEM'] = \"bundler\"` in script to specify gems.\ncap rvm:uninstall_gem GEM=my_gem  # Uninstall gem {my_gem} from the server selected ruby.\ncap rvm:create_alias         # create #{application} alias\ncap rvm:create_wrappers      # create wrappers for gem executables\ncap rvm:show_alias_path      # show path to aliased path with wrappers\n```\n\n## Development\n\nSM Framework extension for gem development:\n\n    $ curl -L https://get.smf.sh | sh\n    $ sm ext install gem mpapis/sm_gem\n    $ sm gem --help\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frvm%2Frvm-capistrano","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frvm%2Frvm-capistrano","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frvm%2Frvm-capistrano/lists"}