I’m trying to automate a ruby app deployment on a Windows machine with a batch script.
Everything is going dandy, except for the following line:
gem install bundler
If I type this in manually, all goes well. If I use a batch script, however, the process is killed as soon as the installation completes. This is what I’m using:
pause
gem install bundler --no-ri --no-rdoc
pause
I’ve tried with the -f switch and also all docs; nothing seems to prevent the window from getting killed. I need the process to stay alive so I can bundle install. Any idea why this is happening, and how I can keep it alive post-install?
gemis a batch file (gem.bat). When you’re invoking a batch file from another one, it is transferring control to it and not resuming.You should try using
CALLinstead:Documentation here:
http://ss64.com/nt/call.html
You can also avoid the batch file by doing
ruby -S gem ...which is more verbose and will work since there is agem(extensionless) file alonggem.bat.Hope that helps.