From: Timothy Goddard Date: 2006-10-12T04:30:18+09:00 Subject: Re: Silent install of a gem and its dependencies 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" > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~