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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T04:36:15+00:00 2026-05-28T04:36:15+00:00

I have installed rvm (mutiuser option) and ruby using rvm install on my test

  • 0

I have installed rvm (mutiuser option) and ruby using “rvm install” on my test server running Ubuntu.
If I log in and execute “ruby test.rb”, the script runs correctly.
But If I execute it using “exec” from my php code, I get an error.

If I “su www-data” and try to execute the script then I get the same error, so I guess the question is how to get “www-data” to have the correct environment to execute Ruby scripts. I’ve already tried adding “www-data” to “rvm” group and doesn’t work. If I give the full path to Ruby bin, then the script executes, but fails when requiring gems.

I’ve also tried executing a .sh where the fist line is “rvm use ruby-xxx” and the second line is “ruby test.rb” and doesn’t work either.

Should I install Ruby using “apt-get install”?

Thanks a lot.

  • 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-28T04:36:16+00:00Added an answer on May 28, 2026 at 4:36 am

    Hm, I don’t know about multi-user version, but if you were running a single user version, you could run scripts as that user, like this:

    /bin/su - postgres -c "/path/to/backup_db.sh /tmp/test"
    

    See this question and answers.

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

Sidebar

Related Questions

I'm running Ubuntu 11.10 and have installed rvm using the standard instructions listed here
I am attempting to install Ruby with RVM. I already have Ruby installed, but
I have recently installed RVM on a fresh install of Ubuntu 11.10 and can
I have installed Ubuntu 11.04 and tried to install Ruby as apt-get install ruby
I'm running Ruby 1.9.1p243 on CentOS, and I decided to install rvm to handle
so now (finally after 4 hours) i have installed ruby 1.9.1, rvm and passenger.
I've installed Ruby 1.9.2 through RVM on a fresh install of OS X Lion.
I am trying to configure JRuby using RVM on Ubuntu Linux. I have successfully
I'm trying to install Ruby on Rails using RVM. I am following this guide
So, I have rvm installed on my machine, and I type: rvm install jruby

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.