Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Yet Another Problem #77

Open
ghost opened this issue Jun 13, 2016 · 9 comments
Open

Yet Another Problem #77

ghost opened this issue Jun 13, 2016 · 9 comments

Comments

@ghost
Copy link

ghost commented Jun 13, 2016

After doing Sudo ruby xxxx.rb
/usr/uibl ruibylgews/1.9.1/ (Errno: :EBUSY) e Device or resource busy /sys/class/gpio/export r from piper-2.0.0/u b:65:in export from /usr/lib/ piper-2.e.e/uib/pi piper/bca283 b:34:in pin input. piper.2.0.0/uib/pi piper/pin.rb: sin initialize from /usr/lib/ruby/gems/1.9.1/gems/pi piper 2.0.0/uib/pi piper.rb115:in from /usr/lib/ruby/gems/1.9.1/gems/pi piper-2,0.0/uib/pi piper,rb1151in new block in Watch

Not completely correct.
Sorry😀

@zsyed91
Copy link
Collaborator

zsyed91 commented Jun 15, 2016

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.

@ghost
Copy link
Author

ghost commented Jun 17, 2016

I don't know how to use RvmSudo

On Jun 15, 2016, at 1:21 PM, Zshawn Syed notifications@github.com 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.

@zsyed91
Copy link
Collaborator

zsyed91 commented Jun 20, 2016

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.

@ghost
Copy link
Author

ghost commented Jun 23, 2016 via email

@zsyed91
Copy link
Collaborator

zsyed91 commented Jun 25, 2016

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.

@zsyed91
Copy link
Collaborator

zsyed91 commented Jul 27, 2016

@riolibrary Did you get your project working?

@ghost
Copy link
Author

ghost commented Jul 30, 2016

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

@elmatou
Copy link
Contributor

elmatou commented Jul 31, 2016

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.

@maraaaa
Copy link

maraaaa commented Sep 26, 2016

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants