Silent install of a gem and its dependencies

Discussion in 'Ruby' started by Jan Svitok, Oct 11, 2006.

  1. Jan Svitok

    Jan Svitok Guest

    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.
     
    Jan Svitok, Oct 11, 2006
    #1
    1. Advertising

  2. Jan Svitok

    vasudevram Guest

    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"
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     
    vasudevram, Oct 11, 2006
    #2
    1. Advertising

  3. 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"
    > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     
    Timothy Goddard, Oct 11, 2006
    #3
  4. Jan Svitok

    Alex Young Guest

    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
     
    Alex Young, Oct 11, 2006
    #4
  5. Jan Svitok

    Jan Svitok Guest

    On 10/12/06, Alex Young <> 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.
     
    Jan Svitok, Oct 11, 2006
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Charles A. Lackman

    Silent Install

    Charles A. Lackman, Feb 18, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    2,140
    Fireface
    Mar 15, 2005
  2. RJGraham
    Replies:
    8
    Views:
    10,414
    Ryan Stewart
    Feb 14, 2004
  3. thunk
    Replies:
    1
    Views:
    366
    thunk
    Mar 30, 2010
  4. thunk
    Replies:
    0
    Views:
    541
    thunk
    Apr 1, 2010
  5. thunk
    Replies:
    14
    Views:
    665
    thunk
    Apr 3, 2010
Loading...

Share This Page