如何修复ruby错误:sh:1:make:找不到 [英] How to fix ruby error: sh: 1: make: not found

查看:150
本文介绍了如何修复ruby错误:sh:1:make:找不到的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在通过 http://gettingstartedwithdjango.com上的视频教程进行工作/ en / lessons / introduction-and-launch /

我正在使用win7并在终端中使用git-bash。我已经安装了最新的virtualbox-4.2.12和最新的vagrant-1.22。

I am working on win7 and using git-bash for my terminal. I have installed the latest virtualbox - 4.2.12 and the latest vagrant - 1.22.

我试图让无业游民跑起来并得到:

I tried to run vagrant up and got:

  $ vagrant up
  Bringing machine 'default' up with 'virtualbox' provider...
  [default] Setting the name of the VM...
  [default] Clearing any previously set forwarded ports...
  [default] Creating shared folders metadata...
  [default] Clearing any previously set network interfaces...
  [default] Preparing network interfaces based on configuration...
  [default] Forwarding ports...
  [default] -- 22 => 2222 (adapter 1)
  [default] -- 8000 => 8888 (adapter 1)
  [default] Booting VM...
  [default] Waiting for VM to boot. This can take a few minutes.
  [default] VM booted and ready for use!
  [default] Configuring and enabling network interfaces...
  [default] Mounting shared folders...
  [default] -- /vagrant
  [default] -- /tmp/vagrant-chef-1/chef-solo-1/cookbooks
  [default] -- /tmp/vagrant-chef-1/chef-solo-2/cookbooks
  [default] Running provisioner: shell...
  [default] Running: inline script
  stdin: is not a tty
  ERROR:  Error installing chef:
          ERROR: Failed to build gem native extension.      

          /usr/bin/ruby1.8 extconf.rb
  creating Makefile      

  make
  sh: 1: make: not found    


  Gem files will remain installed in /var/lib/gems/1.8/gems/yajl-ruby-1.1.0 for in
  spection.
  Results logged to /var/lib/gems/1.8/gems/yajl-ruby-1.1.0/ext/yajl/gem_make.out
  Building native extensions.  This could take a while...
  The following SSH command responded with a non-zero exit status.
  Vagrant assumes that this means the command failed!      

      chmod +x /tmp/vagrant-shell && /tmp/vagrant-shell

当我这样做时:

$ which make

我得到:

/c/opscode/chef/embedded/bin/make

所以make似乎在文件路径中

so it looks like make is in filepath

我该如何解决?

附录:当我将vagrantfile编辑为:

addendum: when I edit the vagrantfile to:

config.vm.provision:shell,:inline => curl -L https://opscode.com/chef/install.sh | bash

config.vm.provision :shell, :inline => "curl -L https://opscode.com/chef/install.sh | bash"

我得到:

/tmp/vagrant-shell: line 1: curl: command not found


推荐答案

您使用的基本框没有 build -essential软件包,默认情况下已安装,并且具有 shell设置程序将Chef gem安装到默认的Ruby环境中。 Chef对JSON RubyGem有依赖性,JSON RubyGem本身具有必须编译的C扩展。这就是寻找 make 的目的。

The basebox you're using does not have the "build-essential" package installed by default, and it has a "shell provisioner" that installs the Chef gem into the default Ruby environment. Chef has a dependency on the JSON RubyGem, which itself has C extensions that must be compiled. This is what is looking for make.

要解决此问题,我建议使用Opscode的 omnibus Chef的完整堆栈安装程序。可以通过将Shell Provisioner行更改为以下方式来使用:

To resolve this issue, I'd recommend using Opscode's "omnibus" full stack installer for Chef. This can be used by changing the shell provisioner line to:

config.vm.provision :shell, :inline => "curl -L https://opscode.com/chef/install.sh | bash"

或,如果您的基盒没有卷曲,请使用wget:

Or, if your basebox doesn't have curl, use wget:

config.vm.provision :shell, :inline => "wget -O https://opscode.com/chef/install.sh | bash"

[install.sh] [3] 脚本仅检查虚拟机以确定其平台是什么,以便可以从S3存储桶中检索正确的URL。如果愿意,可以使用构造的URL直接下载.deb文件:

The [install.sh][3] script simply inspects the VM to determine what its platform is so it can retrieve the proper URL from an S3 bucket. If you prefer you can use the constructed URL to download the .deb file directly:

https://opscode-omnibus-packages.s3.amazonaws.com/ubuntu/11.04/x86_64/ Chef_11.4.4-2.ubuntu.11.04_amd64.deb

然后安装它:

dpkg -i chef_11.4.4-2.ubuntu.11.04_amd64.deb

请参阅 shell配置程序上的Vagrant文​​档,以了解如何编写此内容作为一个小的脚本。

See the Vagrant documentation on shell provisioners to see how to write this as a small script.

这篇关于如何修复ruby错误:sh:1:make:找不到的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆