Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7720919
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T03:47:31+00:00 2026-06-01T03:47:31+00:00

I am using Capistrano to bootstrap an empty Ubuntu VM. I have a base

  • 0

I am using Capistrano to bootstrap an empty Ubuntu VM.

I have a base recipe that installs base requirements:

recipes/base.rb

def set_default(name, *args, &block)
  set(name, *args, &block) unless exists?(name)
end

namespace :deploy do
  desc "Install everything onto the server"
  task :install do
    run "#{sudo} apt-get -y update"

    # Common dependencies
    run "#{sudo} apt-get -y install curl git-core build-essential python-software-properties"
    run "#{sudo} apt-get -y install sudo apt-get -y install build-essential openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison subversion"

    # Set timezone to UTC
    run "#{sudo} bash -c 'echo UTC > /etc/timezone'"
    run "#{sudo} cp /usr/share/zoneinfo/UTC /etc/localtime"
    run "#{sudo} dpkg-reconfigure -f noninteractive tzdata"
  end
end

I also have a recipe for installing rvm. I use the rvm-capistrano gem for this:

recipes/rvm.rb

set_default(:rvm_ruby_string) { "1.9.3@#{application}" }
set_default(:rvm_install_type, :stable)
set_default(:rvm_type, :user)

require 'rvm/capistrano'

after 'deploy:setup', 'rvm:install_rvm'
after 'deploy:setup', 'rvm:install_ruby'

It appears as if the rvm-capistrano gem is modifying the default shell for every task and appending:

rvm_path=$HOME/.rvm/ $HOME/.rvm/bin/rvm-shell '1.9.3@application'

The repercussion of this is that my base recipe is no longer working since it is runned before installing rvm:

cjoudrey (master) app$ cap deploy:install
  * executing `deploy:install'
  * executing "sudo -p 'sudo password: ' apt-get -y update"
    servers: ["33.33.33.10"]
    [33.33.33.10] executing command
    [33.33.33.10] rvm_path=$HOME/.rvm/ $HOME/.rvm/bin/rvm-shell '1.9.3@app' -c 'sudo -p '\''sudo password: '\'' apt-get -y update'
 ** [out :: 33.33.33.10] bash: /home/vagrant/.rvm/bin/rvm-shell: No such file or directory
    command finished in 45ms
failed: "rvm_path=$HOME/.rvm/ $HOME/.rvm/bin/rvm-shell '1.9.3@app' -c 'sudo -p '\\''sudo password: '\\'' apt-get -y update'" on 33.33.33.10
cjoudrey (master) app$

deploy.rb

require 'bundler/capistrano'

load 'config/recipes/base'
load 'config/recipes/rvm'
load 'config/recipes/nginx'
load 'config/recipes/mysql'
load 'config/recipes/nodejs'

server '33.33.33.10', :web, :app, :db, primary: true

set :user, 'vagrant'
set :application, 'app'
set :deploy_to, "/home/#{user}/apps/#{application}"
set :deploy_via, :remote_cache
set :use_sudo, false

set :scm, 'git'
set :repository, 'git@github.com:cjoudrey/test.git'
set :branch, 'master'

default_run_options[:pty] = true
ssh_options[:forward_agent] = true
ssh_options[:keys] = `vagrant ssh-config | grep IdentityFile`.split(' ').last

after 'deploy', 'deploy:cleanup'

Has anyone had this issue before? Is there a way to control when rvm-capistrano modifies the default shell? i.e. Is there a way to have it not modify the default shell for deploy:install?

Should I just make my own rvm recipe instead of using rvm-capistrano?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T03:47:33+00:00Added an answer on June 1, 2026 at 3:47 am

    I had a similar problem, and ended up writing a disable_rvm_shell function in my deploy.rb. I documented this in a blog entry: Capistrano, system wide RVM and creating gemsets as part of deploy:setup.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a app that I'm deploying to a development server using Capistrano. I'd
I have a capistrano deployment recipe I've been using for some time to deploy
I'm using Capistrano and have everything configured. The weird issue I have is that
Using TortoiseSVN against VisualSVN I delete a source file that I should not have
I have a Ruby on Rails 3.2 app using bundler and capistrano for deployment.
I am using Capistrano to deploy to a Ubuntu 11.10 host using rvm and
I'm using Capistrano to deploy an application that uses the theme_support plugin , and
I'm on ubuntu 11.10. When I need to deploy using capistrano, unless I write
I am using Capistrano to manage a Java web app that is running on
I have deployed a rails app on unicorn, and am using Capistrano to manage

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.