2013-10-04 138 views
1

我试图在Windows上安装Rails应用程序。当我调用这个命令:Make不被识别为内部或外部命令

bundle install 

我得到这个错误:

enter image description here

如何解决呢?

+0

是在你的道路上? – doctorlove

+0

我已经创建了新的目录C:/ ruby​​/myapp,并且当我输入bundle install时出现此错误。 –

回答

5

你需要安装一个Ruby的开发工具包如下所述:https://github.com/oneclick/rubyinstaller/wiki/Development-Kit

它将安装一个MinGW的环境,允许RubyGems的编译二进制的宝石适用于Windows平台。

小心遵循本节所述的安装后步骤:https://github.com/oneclick/rubyinstaller/wiki/Development-Kit#4-run-installation-scripts

只要有您的硬盘驱动器上的红宝石的devkit文件是不够的,RubyGems的,以利用它。

+0

我已经安装并且出现相同的错误。 –

+1

您是否看到以下消息:“暂时增强PATH以包含DevKit ...”?否则,devkit安装不正确。 – SirDarius

+0

我可以在哪里查看此消息? –

0

这个bundle install命令包含在Ruby DevKit中。

确保如果您已正确安装了Ruby开发工具包(https://rubyinstaller.org/add-ons/devkit/),它还可以找到您的HD上安装了Ruby的位置。

当您使用命令ruby dk.rb init你应该得到类似这样的消息

[INFO] found RubyInstaller v2.3.3 at C:/Ruby23-x64 

您还可以使用ruby dk.rb review命令,以确保已的devkit找到了红宝石您的安装路径。你应该得到类似这样的消息

Based upon the settings in the 'config.yml' file generated 
from running 'ruby dk.rb init' and any of your customizations, 
DevKit functionality will be injected into the following Rubies 
when you run 'ruby dk.rb install'. 

C:/Ruby23-x64 

一旦你快乐地与配置文件中指定的目录,运行ruby dk.rb install命令。如果您要重新安装DevKit,则可以使用-f命令覆盖先前完成的任何操作。

您应该看到这样的事情(如果你使用-f):

[WARN] Updating (with backup) existing gem override for 'C:/Ruby23-x64' 
[WARN] Updating (with backup) DevKit helper library for 'C:/Ruby23-x64' 

一旦这样做了,你可以查看你的devkit已通过运行install json --platform=ruby命令正确安装,之后就应该看到:

Temporarily enhancing PATH to include DevKit... 
Building native extensions. This could take a while... 
Successfully installed json-2.1.0 
Parsing documentation for json-2.1.0 
Installing ri documentation for json-2.1.0 
Done installing documentation for json after 2 seconds 
1 gem installed 

一旦你的JSON安装开始,你知道你的devkit已成功安装,应防止“做出”错误的发生。

相关问题