由于缺少 make 命令,捆绑包安装失败

发布于 2024-10-30 07:30:56 字数 3585 浏览 2 评论 0原文

我正在尝试运行“捆绑安装”。我已经安装了 Ruby devkit 并将其添加到我的路径中。它抱怨 make 不是一个可识别的命令。这不是devkit应该添加的吗?当寻找这个问题的答案时,每个答案似乎都是“安装devkit”。我使用的是 Windows 7,配置环境以允许其构建 gems 的最简单方法是什么?

我收到以下输出:

$ bundle install
Fetching source index for http://rubygems.org/
Using rake (0.8.7)
Using activesupport (2.3.11)
Using rack (1.1.0)
Using actionpack (2.3.11)
Using actionmailer (2.3.11)
Using activerecord (2.3.11)
Using activeresource (2.3.11)
Using annotate (2.4.0)
Using authlogic (2.1.6)
Using columnize (0.3.2)
Using haml (3.0.25)
Using compass (0.10.6)
Using configuration (1.2.0)
Using daemons (1.0.10)
Using declarative_authorization (0.5.2)
Using delayed_job (2.0.7)
Using i18n (0.5.0)
Using faker (0.9.5)
Using mocha (0.9.12)
Using will_paginate (2.3.15)
Using haml_scaffold (1.1.0)
Installing json (1.4.6) with native extensions c:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/installer.rb:483:in `build_extensions': ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError)

c:/Ruby187/bin/ruby.exe extconf.rb
checking for re.h... yes
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:/Ruby187/lib/ruby/gems/1.8/gems/json-1.4.6 for inspection.
Results logged to c:/Ruby187/lib/ruby/gems/1.8/gems/json-1.4.6/ext/json/ext/generator/gem_make.out
        from c:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/installer.rb:446:in `each'
        from c:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/installer.rb:446:in `build_extensions'
        from c:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/installer.rb:198:in `install'
        from c:/Ruby187/lib/ruby/gems/1.8/gems/bundler-1.0.11/lib/bundler/source.rb:96:in `install'
        from c:/Ruby187/lib/ruby/gems/1.8/gems/bundler-1.0.11/lib/bundler/installer.rb:55:in `run'
        from c:/Ruby187/lib/ruby/gems/1.8/gems/bundler-1.0.11/lib/bundler/spec_set.rb:12:in `each'
        from c:/Ruby187/lib/ruby/gems/1.8/gems/bundler-1.0.11/lib/bundler/spec_set.rb:12:in `each'
        from c:/Ruby187/lib/ruby/gems/1.8/gems/bundler-1.0.11/lib/bundler/installer.rb:44:in `run'
        from c:/Ruby187/lib/ruby/gems/1.8/gems/bundler-1.0.11/lib/bundler/installer.rb:8:in `install'
        from c:/Ruby187/lib/ruby/gems/1.8/gems/bundler-1.0.11/lib/bundler/cli.rb:226:in `install'
        from c:/Ruby187/lib/ruby/gems/1.8/gems/bundler-1.0.11/lib/bundler/vendor/thor/task.rb:22:in `send'
        from c:/Ruby187/lib/ruby/gems/1.8/gems/bundler-1.0.11/lib/bundler/vendor/thor/task.rb:22:in `run'
        from c:/Ruby187/lib/ruby/gems/1.8/gems/bundler-1.0.11/lib/bundler/vendor/thor/invocation.rb:118:in `invoke_task'
        from c:/Ruby187/lib/ruby/gems/1.8/gems/bundler-1.0.11/lib/bundler/vendor/thor.rb:246:in `dispatch'
        from c:/Ruby187/lib/ruby/gems/1.8/gems/bundler-1.0.11/lib/bundler/vendor/thor/base.rb:389:in `start'
        from c:/Ruby187/lib/ruby/gems/1.8/gems/bundler-1.0.11/bin/bundle:13
        from c:/Ruby187/bin/bundle:19:in `load'
        from c:/Ruby187/bin/bundle:19

Gemfile:

source 'http://rubygems.org'

gem 'rails', '2.3.11'
gem 'paper_trail', '~> 1'
gem 'will_paginate', '~> 2.3.11'
gem 'paperclip', '~> 2.3'
gem 'haml'
gem 'compass', '>= 0.10.6'
gem 'authlogic'
gem 'declarative_authorization'
gem 'delayed_job', '~> 2.0.4'

group :development, :test do
  gem 'heroku'
  gem 'sqlite3'
  gem 'heroku_san'
  gem 'ruby-debug'
  gem 'faker'
  gem 'rcov'
  gem 'annotate'
  gem 'mocha'
  gem 'haml_scaffold'
end

group :production do
  # TODO
end

I'm attempting to run "bundle install". I've already installed the Ruby devkit and have it added to my path. It complains about make not being a recognized command. Isn't that what devkit is supposed to add? When searching for answers to this issue, every answer seems to be "install devkit". I'm on Windows 7, what would be the easiest way to configure my environment to allow it to build gems?

I receive the following output:

$ bundle install
Fetching source index for http://rubygems.org/
Using rake (0.8.7)
Using activesupport (2.3.11)
Using rack (1.1.0)
Using actionpack (2.3.11)
Using actionmailer (2.3.11)
Using activerecord (2.3.11)
Using activeresource (2.3.11)
Using annotate (2.4.0)
Using authlogic (2.1.6)
Using columnize (0.3.2)
Using haml (3.0.25)
Using compass (0.10.6)
Using configuration (1.2.0)
Using daemons (1.0.10)
Using declarative_authorization (0.5.2)
Using delayed_job (2.0.7)
Using i18n (0.5.0)
Using faker (0.9.5)
Using mocha (0.9.12)
Using will_paginate (2.3.15)
Using haml_scaffold (1.1.0)
Installing json (1.4.6) with native extensions c:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/installer.rb:483:in `build_extensions': ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError)

c:/Ruby187/bin/ruby.exe extconf.rb
checking for re.h... yes
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:/Ruby187/lib/ruby/gems/1.8/gems/json-1.4.6 for inspection.
Results logged to c:/Ruby187/lib/ruby/gems/1.8/gems/json-1.4.6/ext/json/ext/generator/gem_make.out
        from c:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/installer.rb:446:in `each'
        from c:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/installer.rb:446:in `build_extensions'
        from c:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/installer.rb:198:in `install'
        from c:/Ruby187/lib/ruby/gems/1.8/gems/bundler-1.0.11/lib/bundler/source.rb:96:in `install'
        from c:/Ruby187/lib/ruby/gems/1.8/gems/bundler-1.0.11/lib/bundler/installer.rb:55:in `run'
        from c:/Ruby187/lib/ruby/gems/1.8/gems/bundler-1.0.11/lib/bundler/spec_set.rb:12:in `each'
        from c:/Ruby187/lib/ruby/gems/1.8/gems/bundler-1.0.11/lib/bundler/spec_set.rb:12:in `each'
        from c:/Ruby187/lib/ruby/gems/1.8/gems/bundler-1.0.11/lib/bundler/installer.rb:44:in `run'
        from c:/Ruby187/lib/ruby/gems/1.8/gems/bundler-1.0.11/lib/bundler/installer.rb:8:in `install'
        from c:/Ruby187/lib/ruby/gems/1.8/gems/bundler-1.0.11/lib/bundler/cli.rb:226:in `install'
        from c:/Ruby187/lib/ruby/gems/1.8/gems/bundler-1.0.11/lib/bundler/vendor/thor/task.rb:22:in `send'
        from c:/Ruby187/lib/ruby/gems/1.8/gems/bundler-1.0.11/lib/bundler/vendor/thor/task.rb:22:in `run'
        from c:/Ruby187/lib/ruby/gems/1.8/gems/bundler-1.0.11/lib/bundler/vendor/thor/invocation.rb:118:in `invoke_task'
        from c:/Ruby187/lib/ruby/gems/1.8/gems/bundler-1.0.11/lib/bundler/vendor/thor.rb:246:in `dispatch'
        from c:/Ruby187/lib/ruby/gems/1.8/gems/bundler-1.0.11/lib/bundler/vendor/thor/base.rb:389:in `start'
        from c:/Ruby187/lib/ruby/gems/1.8/gems/bundler-1.0.11/bin/bundle:13
        from c:/Ruby187/bin/bundle:19:in `load'
        from c:/Ruby187/bin/bundle:19

Gemfile:

source 'http://rubygems.org'

gem 'rails', '2.3.11'
gem 'paper_trail', '~> 1'
gem 'will_paginate', '~> 2.3.11'
gem 'paperclip', '~> 2.3'
gem 'haml'
gem 'compass', '>= 0.10.6'
gem 'authlogic'
gem 'declarative_authorization'
gem 'delayed_job', '~> 2.0.4'

group :development, :test do
  gem 'heroku'
  gem 'sqlite3'
  gem 'heroku_san'
  gem 'ruby-debug'
  gem 'faker'
  gem 'rcov'
  gem 'annotate'
  gem 'mocha'
  gem 'haml_scaffold'
end

group :production do
  # TODO
end

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

静若繁花 2024-11-06 07:30:56

问题是我在 Windows 命令提示符之外的其他位置安装了 devkit。确保你使用它。如果您已经尝试使用其他东西安装它,请运行:

ruby dk.rb install --force

The issue was I installed devkit in something other than the Windows Command Prompt. Make sure you use that. If you already tried to install it with something else, run:

ruby dk.rb install --force
铃予 2024-11-06 07:30:56

我遇到了同样的问题。

纠结了一段时间后,我重新启动Windows,问题就神奇地解决了。

I encountered same issue.

After struggling for a while, I rebooted the Windows and problems were solved magically.

娇柔作态 2024-11-06 07:30:56

编辑:注意:以下步骤适用于 linux,我只花时间回答这个问题,因为它作为第一个响应出现在谷歌上,我认为它可能对其他人有帮助。 Windows 答案已经给出,并且已经被选为正确的答案。

===

在安装ruby后尝试安装rails时,我在linux中遇到了同样的问题。

当我安装 ruby​​ 时,依赖项之一是 gcc ,这会让您认为 ma​​ke 也已安装。

只需继续安装 make:sudo apt-get install make 或者,如果您像我一样并且不想再次遇到问题,只需运行:sudo apt-get install build-essential 涵盖所有内容:)

EDIT: NOTE: Steps below are for linux and I only took the time to answer this because it came up on google as the first response and I though it might help someone else. The windows answer is already given and already selected as the right one.

===

I got the same problem in linux when trying to install rails after installing ruby.

When I installed ruby one of the dependencies is gcc which would make you think make is installed as well.

Just go ahead and install make: sudo apt-get install make or if you are like me and don't want to run into issues again just run: sudo apt-get install build-essential to cover it all :)

会傲 2024-11-06 07:30:56

您需要确保已安装 gcc/g++ 和 make。 Ruby 是基于 C 构建的,因此您需要 C 编译器(使用 make)来确保一切正常运行。

有关如何安装 GCC 的提示

You need to make sure you have gcc/g++ and make installed. Ruby is built on C so you will need the C compiler (which uses make) to ensure everything is running properly.

Tips for how to install GCC

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文