Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Batch file doesn't run the next command after 'gem install'

Tags:

batch-file

gem

I made a batch file trying to setup rake/albacore environment on windows:

@echo off

echo Setting up rake environment for building

echo Installing Bundler
gem install bundler

echo Bundle Installing gems
bundle install

When I run this batch file (either double click or run inside a cmd window), only the first gem command is executed. The 'bundle install' is never called. Here is the output:

C:\>InstallGems.bat
Setting up rake environment for building
Installing Bundler
Successfully installed bundler-1.2.1
1 gem installed
Installing ri documentation for bundler-1.2.1...
Installing RDoc documentation for bundler-1.2.1...

C:\>

I have added 'pause' after the first 'gem install' command and it seems the 'pause' is never executed either.

Any idea?

like image 667
AZ. Avatar asked Nov 07 '12 18:11

AZ.


1 Answers

Ahh, I figured it out: just add 'call' before each command.

@echo off

echo Setting up rake environment for building

echo Installing Bundler
call gem install bundler

echo Bundle Installing gems
call bundle install 
like image 95
AZ. Avatar answered Nov 18 '22 14:11

AZ.