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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T19:29:18+00:00 2026-05-30T19:29:18+00:00

I would like ruby scripts with the header #! /usr/bin/ruby to execute using the

  • 0

I would like ruby scripts with the header #! /usr/bin/ruby to execute using the currently in use rvm version of ruby. I run into the issue where I am using a given version but upon executing the script the system ruby is invoked. Installing RVM for every user on the system is not an option.

Problem:

ruby -v
ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-darwin11.3.0]

/usr/bin/ruby -v
ruby 1.8.7 (2010-01-10 patchlevel 249) [universal-darwin11.0]

How to make it the following without performing a system wide install of RVM?

ruby -v
ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-darwin11.3.0]

ruby -v
ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-darwin11.3.0]
  • 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-30T19:29:20+00:00Added an answer on May 30, 2026 at 7:29 pm

    If you do which ruby, you’ll find that RVM’s ruby does not lie at /usr/bin/ruby. Instead use:

    #!/usr/bin/env ruby
    

    This will tell it to look up which ruby to use in the current environment (essentially the $PATH).

    You could also execute your script via ruby itself: ruby myscript.rb

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

Sidebar

Related Questions

In the Bash shell, I would like to run a directory of ruby scripts
I would like to be able to run ruby and perl scripts from build.xml
I would like to execute an OS command from my ruby script but I
I'm writing a Ruby script and would like to use a n-ary tree data
I would like to use Ruby Net::SMTP to send email. The routine send_message( msgstr,
I would like to encode some plain text using Ruby and the Crypt library
I would like to run for example a synchronizing ruby script (in rails action
I would like to specify which ruby interpreter and which gemset to use inside
I would like to use the bigdecimal/newton module in Ruby for an implementation of
I would like to write simple scripts in C#. Stuff I would normally use

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.