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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T10:02:51+00:00 2026-05-24T10:02:51+00:00

RVM is not working over SSH. At the command-line: leifg@host:~$ which ruby /usr/local/rvm/rubies/ruby-1.9.2-p290/bin/ruby Connected

  • 0

RVM is not working over SSH.

At the command-line:

leifg@host:~$ which ruby
/usr/local/rvm/rubies/ruby-1.9.2-p290/bin/ruby

Connected over SSH:

local:~$ ssh leifg@server 'which ruby'
/usr/bin/ruby

I’m using Ubuntu 11.04.

How do I get SSH to use the same Ruby as it is on the system?

I already verified some prequisites:

  • Ruby was already installed using apt-get install ruby. Does that make any difference?
  • sshd_config has the option “PermitUserEnvironment yes”, and I restarted the daemon.

The .bashrc on the server contains these lines, but I see the same behavior when I remove them:

if [ -s "$HOME/.rvm/scripts/rvm" ] ; then
  . "$HOME/.rvm/scripts/rvm"
elif [ -s "/usr/local/rvm/scripts/rvm" ] ; then
  . "/usr/local/rvm/scripts/rvm"
fi
  • 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-05-24T10:02:51+00:00Added an answer on May 24, 2026 at 10:02 am

    From the ssh man page:

    If command is specified, it is executed on the remote host instead of
    a login shell.

    This should mean that your .bashrc won’t get sourced, so RVM doesn’t get set up.

    Solution

    This did the trick in the end:

    ssh <host> bash --login -c <command>
    

    Start bash as a login shell through SSH and then start the RVM installed Ruby via SSH’s -c option.

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

Sidebar

Related Questions

Based on my previous thread : RVM installed by Ruby not working? where i
I rather cleverly (or not in hindsight) installed RVM, which kept hanging whilst compiling
Not sure why I'm getting this, but I just installed RVM, the new Ruby
/usr/local/lib/ruby/1.9.1/yaml.rb:56:in `': It seems your ruby installation is missing psych (for YAML output).To eliminate
Why should I/should I not use RVM? I'm new to the ruby language and
Is there any reason why my present working directory is not on my Ruby
I am trying to install ruby 1.9.2 from a ruby script using rvm which
I am using rvm on my ubyntu 11.10. My readline is not working, I
The whole point of rvm is to be able to install multiple rubies and
My development environment: Ubuntu 9 Ruby 1.9.1/1.8.7 (rvm) Rails 2.3.5 Mysql 5.0 Apache Passenger

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.