Programming a gem install

Hello,

For programming a good reaction to a fail in a gem require, i need
to do a system(‘gem install foo’).
(I know it is a bad idea, but I persist … :slight_smile:

But it seem there are many variation to do that.

So my questions :

How to detect a installation needing ‘sudo’ for gem ?
How to detect a installation needing ‘rvm’ usage ?
How to detect a installation needing ‘pik’ usage ?
Is there other exotic tool which need special gem install command ?

Thank you,

(my current code is there: https://gist.github.com/2043077
, done in Ruiby, http://regisaubarede.posterous.com/)

Regis d’Aubarede wrote in post #1051610:

For programming a good reaction to a fail in a gem require, i need
to do a system(‘gem install foo’).

You don’t need to. The bestest reaction to a fail in require is
already happening: we get a meaningful error message, and we are given
the freedom, an inalienable freedom bestowed upon us by the Creator, to
proceed as we choose.

If you want, you can print a friendlier message to the user when an
Exception occurs.

How I want to manage my system is not a business of yours. It can’t
be a business of yours because you’re not me. Your mentioning “sudo”
is utmost chutzpa.

Had the Creator wanted you to mess with my computer, with my life, he’d
have created all of us in a single being.

(I know it is a bad idea, but I persist … :slight_smile:

So involve yourself with some other bad idea, one that doens’t involve
somebody else’s life. Like jumping off a rooftop.

Albert S. wrote in post #1051624:

For programming a good reaction to a fail in a gem require, i need
to do a system(‘gem install foo’).

You don’t need to. The bestest reaction to a fail in require is
[…]

Hi.

I’m looking back at that answer I gave a couple of hour ago (I’m after a
good, albeit short, sleep). I now see that it was too harsh. Unduly
harsh. A sentence or two there were certainly wicked. I apologize for
writing it. I hope I didn’t hurt you or anybody.

Sorry.

Albert S. wrote in post #1051652:

Albert S. wrote in post #1051624:
I apologize for writing it. I hope I didn’t hurt you or anybody.

no problemo…
my skin become like crocodile … see
http://www.ruby-forum.com/topic/2728297
it’s fun!

I do not anderstand why this subject give so much angry.
Freeware like firefox, libreoffice, fedora, ubuntu, … notice user
when update can be done, ask if user want to do it, and then
do the update.
It is almost exactly what i want to do =:)

So, gtksudo or not ?..

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs