Giter Club home page Giter Club logo

Comments (9)

zsyed91 avatar zsyed91 commented on August 26, 2024

instead of sudo ruby xxx.rb please run rvmsudo ruby xxx.rb.

Check out https://rvm.io/integration/sudo for a detailed explanation. sudo does not pass the session to the script which is why rvmsudo is needed. Please try that and let me know if it works for you.

from pi_piper.

 avatar commented on August 26, 2024

I don't know how to use RvmSudo

On Jun 15, 2016, at 1:21 PM, Zshawn Syed [email protected] wrote:

instead of sudo ruby xxx.rb please run rvmsudo ruby xxx.rb.

Check out https://rvm.io/integration/sudo for a detailed explanation. sudo does not pass the session to the script which is why rvmsudo is needed. Please try that and let me know if it works for you.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.

from pi_piper.

zsyed91 avatar zsyed91 commented on August 26, 2024

Well, its pretty simple:

  1. Install rvm
  2. Install a ruby via rvm install 2.1.0 or if you want latest, rvm install 2.3.0.
  3. Run rvmsudo ruby xxx.rb

Let me know if your script works after doing the above. It is crucial to run the script via rvmsudo.

from pi_piper.

 avatar commented on August 26, 2024

from pi_piper.

zsyed91 avatar zsyed91 commented on August 26, 2024

I don't believe so, if you wanted to use the system ruby or whichever you have installed already. In that case, simply try running step 1 and step 3.

from pi_piper.

zsyed91 avatar zsyed91 commented on August 26, 2024

@riolibrary Did you get your project working?

from pi_piper.

 avatar commented on August 26, 2024

No 😞
@zsyed91 I tried to run:
rvmsudo ruby xxx.rb

and it gave the same error except with something about a secure path

Please help, I have been with this project for a couple months now and would like to finish it

from pi_piper.

elmatou avatar elmatou commented on August 26, 2024

from the few line you posted I can understand that you run with a linux permission issue, which is not specific to PiPiper.

Rasbian requires that gpio are accessed by an user with root privileges (which is not really true with jessy based raspian, but for clarity we will stick to that assomption)

@riolibrary, could you copy/paste an extensive backtrace showing your bug.
Also we need to know which ruby you installed and how you did it.

from pi_piper.

maraaaa avatar maraaaa commented on August 26, 2024

@riolibrary did you ever get this issue resolved? If so, what was the fix?

If not can we try a few things?

  • execute a sudo -i which will drop you to a root shell, then as root, execute your ruby xxxx.rb command.
  • execute sudo -E ruby xxxx.rb, the -E flag tells sudo to "preserve environment". As @zsyed91 points out, it's likely an environment issue. Since you're not using RVM to manage Ruby, I don't think rvmsudo is the solution though. (Though, if I may ask, why aren't you using RVM?)
  • According to the above linked post: the user that is invoking sudo must have export rvmsudo_secure_path=0, and your comment about a secure path error, I would wager that this is not set before running rvmsudo. Did you set this?

Finally, as @elmatou points out, we'll need some more logging to better help you debug. If you can post a full backtrace of your errors it would be immensely helpful.

from pi_piper.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.