【问题标题】:Batch file doesn't run the next command after 'gem install'批处理文件在“gem install”之后不运行下一个命令
【发布时间】:2012-10-27 21:16:04
【问题描述】:

我制作了一个批处理文件,试图在 Windows 上设置 rake/albacore 环境:

@echo off

echo Setting up rake environment for building

echo Installing Bundler
gem install bundler

echo Bundle Installing gems
bundle install

当我运行这个批处理文件(双击或在 cmd 窗口中运行)时,只执行第一个 gem 命令。永远不会调用“捆绑安装”。这是输出:

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:\>

我在第一个“gem install”命令之后添加了“暂停”,似乎也从未执行过“暂停”。

有什么想法吗?

【问题讨论】:

  • Gem 本身可能是一个批处理文件,或者脚本由于错误而以某种方式中止并且没有告诉您错误。

标签: batch-file gem


【解决方案1】:

啊,我想通了:只需在每个命令前添加“调用”即可。

@echo off

echo Setting up rake environment for building

echo Installing Bundler
call gem install bundler

echo Bundle Installing gems
call bundle install 

【讨论】:

猜你喜欢
  • 1970-01-01
  • 2023-04-08
  • 2018-07-25
  • 2011-05-22
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2022-11-06
相关资源
最近更新 更多