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 8371307
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T14:07:48+00:00 2026-06-09T14:07:48+00:00

I’m looking for a way to install rvm, install a specific ruby version (using

  • 0

I’m looking for a way to install rvm, install a specific ruby version (using rvm) and set this installed ruby version as default. Before I can install rvm I have to install gcc and some other very basic software packages. What I’ve tried so far:

1) Using net/ssh

  • I have to simulate a pseudo tty to be able to sudo some commands and up to now,
    I could not figure out, how to tell a success full command completion from a not success full one.
  • after installing rvm, I’ve stumbled over problems using rvm (“rvm is not a function”, error messages, leading to not being able to set a default ruby version).

2) Using capistrano

  • In the ssh output are newlines inserted so that a progress bar for example is been printed in a new line every time, some progress is made. That’s something I can live with.

  • Same Problems with rmv, I’m able to install rvm, but I’m unable to set a default: rvm --default use 1.9.2 for example. No error message, but when I’ve log in later, no default is set and ruby -vshows the old system ruby.

3) Using capistrano and rvm-capistrano

  • Now I ran into the problem, that very task that I try to execute prior to installing rvm fails, because there seems to be some magic that fiddles with the shell default:
 * executing "sudo -p 'sudo password: ' yum install --assumeyes git gcc-c++ autoconf automake make patch zlib-devel libtool bzip2-devel"
   servers: ["ec2-54-247-142-214.eu-west-1.compute.amazonaws.com"]
   [ec2-54-247-142-214.eu-west-1.compute.amazonaws.com] executing command
** [out :: ec2-54-247-142-214.eu-west-1.compute.amazonaws.com] bash: /home/ec2-user/.rvm/bin/rvm-shell: No such file or directory
    command finished in 2094ms
failed: "rvm_path=$HOME/.rvm/ $HOME/.rvm/bin/rvm-shell 'default' -c 'sudo -p '\\''sudo password: '\\'' yum install --assumeyes git gcc-c++ autoconf automake make patch zlib-devel libtool bzip2-devel'" on ec2-54-247-142-214.eu-west-1.compute.amazonaws.com
rake aborted!

Here the commands I issue to install rvm/ruby:

run 'curl -L https://get.rvm.io | bash -s stable'
run 'rvm install ruby-1.9.2-p320'
run 'echo "[[ -s \"\$HOME/.rvm/scripts/rvm\" ]] && source \"\$HOME/.rvm/scripts/rvm\"" >> .bashrc'
run 'rvm --default use ruby-1.9.2-p320'
run 'which ruby && ruby -v'

and here the error messages that is issued as response to rvm --default use 1.9.2

RVM is not a function, selecting rubies with 'rvm use ...' will not work.
You need to change your terminal settings to allow shell login.
Please visit https://rvm.io/workflow/screen/ for example.

4.1) Using capistrano and rvm-capistrano and hacking a little bit

Update: With the help from mpapis at the RVM chat, I was able to come up with this working solution now:
require “rvm/capistrano”

role :server, ENV[ 'base_image_setup_server' ] if ENV[ 'base_image_setup_server' ]

default_run_options[:pty] = true
default_run_options[:shell] = :bash

set :rvm_ruby_string, 'ruby-1.9.2-p320'
set :rvm_type, :user

def rvm_bin
    '$HOME/.rvm/bin/rvm'
end

namespace :images do

    task :install_basics do
        run "#{sudo} yum install --assumeyes git gcc-c++ autoconf automake make patch zlib-devel libtool bzip2-devel"
        run "#{sudo} yum update --assumeyes"
    end

    task :install_ruby do
        rvm.install_rvm
        rvm.install_ruby
        run "#{rvm_bin} alias create default #{rvm_ruby_string}"
        run 'echo "source ~/.rvm/environments/default" >> $HOME/.bashrc'
        run 'which ruby && ruby -v'
    end

    ... 

    desc 'build the base-image'
    task :base_image do 
        install_basics
        install_ruby
        install_boost
        install_rake_and_rack
        install_sioux
        test_sioux
    end

The main different is, that RVM is not used as a function, but the program direct.

kind regards,
Torsten

  • 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-09T14:07:49+00:00Added an answer on June 9, 2026 at 2:07 pm

    Check RVM site for Capistrano integration https://rvm.io/integration/capistrano

    There are tasks to install RVM and Ruby:

    after 'deploy:setup', 'ubuntu:install'
    after 'deploy:setup', 'rvm:install_rvm' # do it only with deploy setup
    before 'deploy', 'rvm:install_ruby'     # do it on every deploy
    namespace :ubuntu do
      desc "setup ubuntu system"
      task :install do
        run "apt-get install -y make ...", :shell => "sh"
        ...
      end
    end
    

    And you run the standard:

    cap deploy:setup
    cap deploy:cold
    

    Also you might want to have a look on my example rails app for simple and working deployment script: https://github.com/mpapis/ad and my blog post about it: http://niczsoft.com/2012/03/fast-deployment-using-capistrano-rvm-and-more/

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

Sidebar

Related Questions

I have a jquery bug and I've been looking for hours now, I can't
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
Does anyone know how can I replace this 2 symbol below from the string
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
For some reason, after submitting a string like this Jack’s Spindle from a text
this is what i have right now Drawing an RSS feed into the php,
I am reading a book about Javascript and jQuery and using one of the
I have this code to decode numeric html entities to the UTF8 equivalent character.

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.