Comments (9)
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.
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.
Well, its pretty simple:
- Install rvm
- Install a ruby via
rvm install 2.1.0
or if you want latest,rvm install 2.3.0
. - 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.
from pi_piper.
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.
@riolibrary Did you get your project working?
from pi_piper.
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.
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.
@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 yourruby 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 thinkrvmsudo
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 runningrvmsudo
. 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)
- Is Pi_Piper ready for RPi 3 ? HOT 4
- Pin.on?/.off? notworking ?
- Seg fault HOT 1
- Gem Version 2.0? HOT 1
- Output pin turns back on after exit HOT 2
- Resource Not Available HOT 2
- Sorry if it's a noob question... HOT 9
- Can't read correct values from a rpi B 1 HOT 5
- One-wire monitoring with PiPiper HOT 2
- Why is lib/pi_piper/driver.rb empty method definitions? HOT 3
- OpenWRT? HOT 1
- tegv
- Behavior of after/watch not as expected HOT 1
- Example of i2c
- Issue with ffi gem dependency
- RPi 3+ 64bits HOT 1
- Race condition on non root user when PiPiper::Pin.new HOT 1
- pi_piper with gtk aborts ruby interpreter (RPi Raspbian Stretch) HOT 1
- Examples with tests
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pi_piper.