【问题标题】:Error while creating new rails app, Failed to build gem native extension创建新的 Rails 应用程序时出错,无法构建 gem 原生扩展
【发布时间】:2016-09-26 20:35:05
【问题描述】:

当我使用这个命令 $ rails new testapp 创建一个新的 Rails 应用程序时 就是这个样子

       exist  vendor/assets/javascripts
   identical  vendor/assets/javascripts/.keep
       exist  vendor/assets/stylesheets
   identical  vendor/assets/stylesheets/.keep
         run  bundle install
Fetching gem metadata from https://rubygems.org/
Fetching version metadata from https://rubygems.org/
Fetching dependency metadata from https://rubygems.org/
Resolving dependencies........
Using rake 11.3.0
Using i18n 0.7.0
Installing json 1.8.3 with native extensions

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    c:/RailsInstaller/Ruby2.1.0/bin/ruby.exe extconf.rb
creating Makefile

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

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

make failed, exit code 1

Gem files will remain installed in c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/json-1.8.3 for inspection.
Results logged to c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/extensions/x86-mingw32/2.1.0/json-1.8.3/gem_make.out
Using minitest 5.9.1
Using thread_safe 0.3.5
Using builder 3.2.2
Using erubis 2.7.0
Using mini_portile2 2.1.0
Using pkg-config 1.1.7
Using rack 1.6.4
Using mime-types-data 3.2016.0521
Using arel 6.0.3
Installing debug_inspector 0.0.2 with native extensions

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    c:/RailsInstaller/Ruby2.1.0/bin/ruby.exe extconf.rb
creating Makefile

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

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

make failed, exit code 1

Gem files will remain installed in c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/debug_inspector-0.0.2 for inspection.
Results logged to c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/extensions/x86-mingw32/2.1.0/debug_inspector-0.0.2/gem_make.out
Using bundler 1.12.5
Installing byebug 9.0.5 with native extensions

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    c:/RailsInstaller/Ruby2.1.0/bin/ruby.exe extconf.rb
creating Makefile

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

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

make failed, exit code 1

Gem files will remain installed in c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/byebug-9.0.5 for inspection.
Results logged to c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/extensions/x86-mingw32/2.1.0/byebug-9.0.5/gem_make.out
Using coffee-script-source 1.10.0
Using execjs 2.7.0
Using thor 0.19.1
Using concurrent-ruby 1.0.2
Using multi_json 1.12.1
Using sass 3.4.22
Using tilt 2.0.5
Using sqlite3 1.3.11
Using turbolinks-source 5.0.0
An error occurred while installing json (1.8.3), and Bundler cannot continue.
Make sure that `gem install json -v '1.8.3'` succeeds before bundling.

当我尝试最后一行中所说的并运行 $ gem install json -v '1.8.3' 时,我得到了同样的错误

Building native extensions.  This could take a while...
ERROR:  Error installing json:
        ERROR: Failed to build gem native extension.

    c:/RailsInstaller/Ruby2.1.0/bin/ruby.exe extconf.rb
creating Makefile

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

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

make failed, exit code 1

Gem files will remain installed in c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/json-1.8.3 for inspection.
Results logged to c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/extensions/x86-mingw32/2.1.0/json-1.8.3/gem_make.out

我是 Rails 新手,所以我不知道这个错误是什么意思,在此先感谢。

【问题讨论】:

  • 这意味着你需要安装 GNU Make。这是一个用于编译和安装其他程序的程序。但是我会考虑使用 Vagrant 来设置运行某种 linux 或使用 Cloud9 的虚拟机。大多数教程都假设您使用 *nix(或至少是真正的 Posix 兼容操作系统)并且在 Windows 上设置 Rails 和所有支持工具可能会很麻烦。

标签: ruby-on-rails json ruby ruby-on-rails-3


【解决方案1】:

您的问题如下:

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

这是一种常见的情况,我建议你阅读相同问题的答案here

【讨论】:

    猜你喜欢
    • 2020-02-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-10-16
    • 2016-02-08
    • 1970-01-01
    • 2023-03-19
    相关资源
    最近更新 更多