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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T01:13:55+00:00 2026-06-15T01:13:55+00:00

When executing a bash shell script I am using ruby 1.9.3. Then, within the

  • 0

When executing a bash shell script I am using ruby 1.9.3. Then, within the script, I want to switch to JRub (I’m using rvm). I tried switching to JRuby by doing rvm use jruby within the script, but this didn’t work, it said:

RVM is not a function, selecting rubies with 'rvm use ...' will not work.

You need to change your terminal emulator preferences to allow login shell.
Sometimes it is required to use `/bin/bash --login` as the command.
Please visit https://rvm.io/integration/gnome-terminal/ for a example.

./run.sh: line 10: jruby: command not found

When I do type rvm | head -n1 at the command prompt, I get: rvm is a function. So I’m not sure of the problem. I thought it might be because I installed JRuby using sudo (sudo rvm install jruby). So I ran the shell script again using sudo. Again I received the error.

How can I switch rubies from within a bash shell script with rvm?

Thanks

  • 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-15T01:13:56+00:00Added an answer on June 15, 2026 at 1:13 am

    I ended up adding this to the line before:

    [[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm"
    

    as explained in this thread (sorry – though I was aware of this thread before, I didn’t quite grasp it):

    RVM doesn't switch Rubies

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

Sidebar

Related Questions

I have a shell script run.sh which is executing a jar file. #!/bin/bash $JAVA_HOME/bin/java
while executing a shell script in Unix Bash Shell, say any file in another
I'm having an issue executing jruby from the mingw git bash shell in windows.
I have my Cocoa app executing a shell script. I want to make it
My shell script: #!/bin/bash if [ $# -lt 2 ] then echo $0 :
Below is my Bash Shell Script from which I am executing my two Hive
Possible Duplicate: Problem executing bash file I have created a bash file script and
I've tried executing the following: #!C:\cygwin\bin\bash.exe ls ${WORKSPACE} But that doesn't find ls (even
Why is this script executing the string in the if statement: #!/bin/bash FILES=* STRING=''
I have a bash script (supports linux/unix), that installs an application. Instead of executing

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.