Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > Silent install of a gem and its dependencies

Reply
Thread Tools

Silent install of a gem and its dependencies

 
 
Jan Svitok
Guest
Posts: n/a
 
      10-11-2006
Hi,

I'm wondering whether there is a way to install a gem and its
dependecies without rubygems asking anything.

I need to deploy on several machines a set of gems. I created special
gem for the purpose that depends on all of them. Even though I install
the gem event with -y and there is only one available choice, rubygems
ask which one I want to install (1. the gem, 2. cancel). Is there a
way to get rid of this question?

TIA
J.

 
Reply With Quote
 
 
 
 
vasudevram
Guest
Posts: n/a
 
      10-11-2006

Jan Svitok wrote:
> Hi,
>
> I'm wondering whether there is a way to install a gem and its
> dependecies without rubygems asking anything.
>
> I need to deploy on several machines a set of gems. I created special
> gem for the purpose that depends on all of them. Even though I install
> the gem event with -y and there is only one available choice, rubygems
> ask which one I want to install (1. the gem, 2. cancel). Is there a
> way to get rid of this question?
>
> TIA
> J.


Hi,

[What do you mean by "gem event"?]

Ans 1: Check the gem help for all relevant options (like -q for quiet,
-s for silent, etc.) if you haven't already.

Ans2: (If Ans 1 doesn't help):

I haven't tried this out (not at my machine right now) but it may work,
if gem reads standard input for the answer:

Create a file called inp.txt that contains a "1" (withut the quotes)
followed by a newline.

gem gem_options your_gem_name < inp.txt

Another way, if you're on Linux or *NIX, may be:

yes | gem gem_options your_gem_name

The yes command writes (in an infinite loop), a "y" followed by a
newline, to standard output.
And if gem reads its standard input for the answer, this may work.

Best way is to try it out.

HTH
Vasudev
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Vasudev Ram
Software training and consulting
10.times say "Truly rural"
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

 
Reply With Quote
 
 
 
 
Timothy Goddard
Guest
Posts: n/a
 
      10-11-2006
vasudevram wrote:
> Jan Svitok wrote:
> > Hi,
> >
> > I'm wondering whether there is a way to install a gem and its
> > dependecies without rubygems asking anything.
> >
> > I need to deploy on several machines a set of gems. I created special
> > gem for the purpose that depends on all of them. Even though I install
> > the gem event with -y and there is only one available choice, rubygems
> > ask which one I want to install (1. the gem, 2. cancel). Is there a
> > way to get rid of this question?
> >
> > TIA
> > J.

>
> Hi,
>
> [What do you mean by "gem event"?]
>
> Ans 1: Check the gem help for all relevant options (like -q for quiet,
> -s for silent, etc.) if you haven't already.
>
> Ans2: (If Ans 1 doesn't help):
>
> I haven't tried this out (not at my machine right now) but it may work,
> if gem reads standard input for the answer:
>
> Create a file called inp.txt that contains a "1" (withut the quotes)
> followed by a newline.
>
> gem gem_options your_gem_name < inp.txt
>
> Another way, if you're on Linux or *NIX, may be:
>
> yes | gem gem_options your_gem_name


If you change this to:

yes 1 | gem gem_options your_gem_name

it will send in ones instead of 'y's

> The yes command writes (in an infinite loop), a "y" followed by a
> newline, to standard output.
> And if gem reads its standard input for the answer, this may work.
>
> Best way is to try it out.
>
> HTH
> Vasudev
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Vasudev Ram
> Software training and consulting
> 10.times say "Truly rural"
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


 
Reply With Quote
 
Alex Young
Guest
Posts: n/a
 
      10-11-2006
Timothy Goddard wrote:
> vasudevram wrote:
>> Jan Svitok wrote:
>>> Hi,
>>>
>>> I'm wondering whether there is a way to install a gem and its
>>> dependecies without rubygems asking anything.
>>>
>>> I need to deploy on several machines a set of gems. I created special
>>> gem for the purpose that depends on all of them. Even though I install
>>> the gem event with -y and there is only one available choice, rubygems
>>> ask which one I want to install (1. the gem, 2. cancel). Is there a
>>> way to get rid of this question?
>>>
>>> TIA
>>> J.

>> Hi,
>>
>> [What do you mean by "gem event"?]
>>
>> Ans 1: Check the gem help for all relevant options (like -q for quiet,
>> -s for silent, etc.) if you haven't already.
>>
>> Ans2: (If Ans 1 doesn't help):
>>
>> I haven't tried this out (not at my machine right now) but it may work,
>> if gem reads standard input for the answer:
>>
>> Create a file called inp.txt that contains a "1" (withut the quotes)
>> followed by a newline.
>>
>> gem gem_options your_gem_name < inp.txt
>>
>> Another way, if you're on Linux or *NIX, may be:
>>
>> yes | gem gem_options your_gem_name

>
> If you change this to:
>
> yes 1 | gem gem_options your_gem_name
>
> it will send in ones instead of 'y's


The problem is that different gems have different platforms appearing as
their '1' choice - I've got a sneaking suspicion that some have even
changed priorities between versions, although I'd be happy to be proved
wrong on that point. I think it needs to be RExpected, but I haven't
needed to do it myself.

--
Alex
--
Alex

 
Reply With Quote
 
Jan Svitok
Guest
Posts: n/a
 
      10-11-2006
On 10/12/06, Alex Young <(E-Mail Removed)> wrote:
> Timothy Goddard wrote:
> > vasudevram wrote:
> >> Jan Svitok wrote:
> >>> Hi,
> >>>
> >>> I'm wondering whether there is a way to install a gem and its
> >>> dependecies without rubygems asking anything.
> >>>
> >>> I need to deploy on several machines a set of gems. I created special
> >>> gem for the purpose that depends on all of them. Even though I install
> >>> the gem event with -y and there is only one available choice, rubygems
> >>> ask which one I want to install (1. the gem, 2. cancel). Is there a
> >>> way to get rid of this question?
> >>>
> >>> TIA
> >>> J.
> >> Hi,
> >>
> >> [What do you mean by "gem event"?]
> >>
> >> Ans 1: Check the gem help for all relevant options (like -q for quiet,
> >> -s for silent, etc.) if you haven't already.
> >>
> >> Ans2: (If Ans 1 doesn't help):
> >>
> >> I haven't tried this out (not at my machine right now) but it may work,
> >> if gem reads standard input for the answer:
> >>
> >> Create a file called inp.txt that contains a "1" (withut the quotes)
> >> followed by a newline.
> >>
> >> gem gem_options your_gem_name < inp.txt
> >>
> >> Another way, if you're on Linux or *NIX, may be:
> >>
> >> yes | gem gem_options your_gem_name

> >
> > If you change this to:
> >
> > yes 1 | gem gem_options your_gem_name
> >
> > it will send in ones instead of 'y's

>
> The problem is that different gems have different platforms appearing as
> their '1' choice - I've got a sneaking suspicion that some have even
> changed priorities between versions, although I'd be happy to be proved
> wrong on that point. I think it needs to be RExpected, but I haven't
> needed to do it myself.


Thanks all for your responses. I was hoping that there is some switch
or magic gem format that will avoid the quesion. Now that I've read
rubygems source, the question will be allways asked when there is a
binary version of the gem.
I'll try the solution with feeding gems with '1's as I run my own
local gemserver and I can set it up so that only one version will be
available.

J.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Its a bird, its a plane, no ummm, its a Ruide thunk Ruby 1 03-30-2010 11:10 AM
I totally messed up rubygems (deleted the sources gem) and now Ican't install any gem anymore kazaam Ruby 1 11-01-2007 07:28 PM
RubyGems 0.9.1 calling a gem with gem '<gem>' Austin 7873 Ruby 5 01-27-2007 10:05 PM
PAgP - silent and non-silent modes andymacca Cisco 1 03-26-2006 06:28 PM
How to determine JDK install directory and/or do silent install of J2SE? RJGraham Java 8 02-14-2004 02:19 PM



Advertisments