0

当我尝试开始一个新的 Rails 项目时,我被卡住了。它为 json 1.7.4 哭泣。我在窗户上。

rails new delete
      create
      create  README.rdoc
.
.
.
         run  bundle install
Fetching source index for https://rubygems.org/
Using rake (0.9.2.2)
Using i18n (0.6.0)
Using multi_json (1.3.6)
Using activesupport (3.2.6)
Using builder (3.0.0)
.
.
.
Using coffee-script (2.2.0)
Using rack-ssl (1.3.2)
Installing json (1.7.4) with native extensions
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension
.
        C:/Programozas/Ruby192/bin/ruby.exe extconf.rb
creating Makefile

make
'make' is not recognized as an internal or external command,
operable program or batch file.


Gem files will remain installed in C:/Programozas/Ruby192/lib/ruby/gems/1.9.1/ge
ms/json-1.7.4 for inspection.
Results logged to C:/Programozas/Ruby192/lib/ruby/gems/1.9.1/gems/json-1.7.4/ext
/json/ext/generator/gem_make.out
An error occured while installing json (1.7.4), and Bundler cannot continue.
Make sure that `gem install json -v '1.7.4'` succeeds before bundling.

它也为 gem install json -v '1.7.4' 删除了相同的错误。我该怎么办?

4

2 回答 2

1

您需要在具有可以理解的软件的环境中运行make。您的 windows 环境似乎没有这样的软件。

看起来在 Windows 上使用 Rails 进行开发的一种常见方法是使用RubyInstaller。SO上有类似问题的人(谷歌搜索30秒后)已经修复了与RubyInstaller附带的DevKit类似的问题,因为它提供了“......一个“健全”的环境......带有make,gcc,sh和类似的*nix 构建工具已安装..."

于 2012-07-28T19:36:14.630 回答
0

我在 Windows 7(32 位)上创建新项目时遇到了类似的问题。我已经在我的 \DevKit 中安装了 DevKit。我收到的错误消息说:

请更新您的 PATH 以包含构建工具或从“http://rubyinstaller.org/downloads”下载 DevKit,并按照“http://github.com/oneclick/rubyinstaller/wiki/Development-Kit”中的说明进行操作。安装 json (1.7.4) 时发生,并且 Bundler 无法继续。gem install json -v '1.7.4'在捆绑之前确保成功。

C:\myrailsproject>gem install json -v 1.7.4 错误:安装 json 时出错:“json”本机 gem 需要安装构建工具。

请更新您的 PATH 以包含构建工具或从“http://rubyinstaller.org/downloads”下载 DevKit,并按照“http://github.com/oneclick/rubyinstaller/wiki/Development-Kit”中的说明进行操作

更新 gem 文件以使用 json 1.7.3 运行一切正常

于 2012-07-29T12:43:38.807 回答