Closed Damaotimlin closed 8 years ago
rvmsudo should do the trick.
rvm requires you install gems in "user space" meaning no sudo. but pi_piper works (for now) only with root permission, meaning sudo.
rvmsudo
or rbenv sudo
depending on your ruby install allows you to run with root permission gems installed in "user space"
Hi @elmatou,
Thanks for your reply!
'rvmsudo' it works fine. Gem installed!
rvmsudo gem install pi_piper
Warning: can not check
/etc/sudoers
forsecure_path
, falling back to call via/usr/bin/env
, this breaks rules from/etc/sudoers
. Run:export rvmsudo_secure_path=1
to avoid the warning, put it in shell initialization file to make it persistent.
In case there is no
secure_path
in/etc/sudoers
. Run:export rvmsudo_secure_path=0
to avoid the warning, put it in shell initialization file to make it persistent. Successfully installed pi_piper-2.0.0 Parsing documentation for pi_piper-2.0.0 Installing ri documentation for pi_piper-2.0.0 Done installing documentation for pi_piper after 8 seconds 1 gem installed
However, when I run the practice again
sudo ruby pi-piper-practice.rb
It still return me
pi-piper-practice.rb:1:in `require': no such file to load -- pi_piper (LoadError) from pi-piper-practice.rb:1
How to check if I installed the pi_piper correctly ?
Thank you again for help me collect the puzzles!
Hi @elmatou,
I just found out two things and problem solved !
One is run
rmvsudo gem install pi_piper
and run ruby file by
rvmsudo ruby ~.rb
All done, thanks !
nice. but I don't think you need rvmsudo for installing the gem, only for running script.
Hi @elmatou
Thanks for your kindly helps!
Hi Folks,
I'm facing an error while I do
sudo gem install pi_piper
It return an error blow :
I use rvm and below is my ruby -v and gem -v and do tried 'gem update --system' but still failed.
My ruby and gem is up to date:
I did follow the instruction and install
libssl-dev
And, I tried to install gem without
sudo
gem install pi_piper
Guess what, it is successfully installed ?!I was thinking I'm so smart to do no 'sudo'. But the story always comes with HOWEVER However, I ran my ruby code, it returns: 'sudo ruby pi-piper-practice.rb'
The pi-piper-practice.rb code listed below:
I couldn't know what I am missing now. Please helps and thanks in advance !!!!!!