Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/356.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/search/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 如何修复ruby错误:sh:1:make:未找到_Python_Ruby_Django_Chef Infra_Vagrant - Fatal编程技术网

Python 如何修复ruby错误:sh:1:make:未找到

Python 如何修复ruby错误:sh:1:make:未找到,python,ruby,django,chef-infra,vagrant,Python,Ruby,Django,Chef Infra,Vagrant,我正在以我的方式通过一个视频教程 我正在使用win7,并在终端上使用git bash。我已经安装了最新的virtualbox-4.2.12和最新的vagrant-1.22 我试图追上流浪汉,结果: $ vagrant up Bringing machine 'default' up with 'virtualbox' provider... [default] Setting the name of the VM... [default] Clearing any previou

我正在以我的方式通过一个视频教程

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

我试图追上流浪汉,结果:

  $ 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
/tmp/vagrant-shell: line 1: curl: command not found
所以看起来make在filepath中

我怎样才能解决这个问题

附录:当我编辑Vagrant文件时:

config.vm.provision:shell,:inline=>“curl-L | bash”

我得到:

/c/opscode/chef/embedded/bin/make
/tmp/vagrant-shell: line 1: curl: command not found

您在哪台机器上运行了
哪个make
?(主宾)。 确保来宾(virtualbox)拥有
Make


如果操作系统没有预装make,而您仍想继续前进,那么您可以按照以下方法进行操作:

e = package "make" do
        action :nothing
end

e.run_action(:install)
它将在编译时安装make包,在您的任何烹饪书尝试使用它之前。
你应该把它放在你的食谱中,最好放在最上面,这样其他读者就可以清楚地知道发生了什么。

你使用的basebox默认没有安装“build essential”包,它有一个“”将Chef gem安装到默认的Ruby环境中。Chef依赖于JSON RubyGem,它本身具有必须编译的C扩展。这就是我们正在寻找的
make

为了解决这个问题,我建议使用Opscode的“综合”。这可以通过将shell provisioner行更改为:

config.vm.provision :shell, :inline => "curl -L https://opscode.com/chef/install.sh | bash"
或者,如果basebox没有卷曲,请使用wget:

config.vm.provision :shell, :inline => "wget -O https://opscode.com/chef/install.sh | bash"
[install.sh][3]
脚本只是检查虚拟机以确定其平台是什么,这样它就可以从S3存储桶中检索正确的URL。如果愿意,可以使用构造的URL直接下载.deb文件:

然后安装它:

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

请参阅上的Vagrant文档,了解如何将其作为一个小脚本编写。

它成功了,感谢我使用了错误版本的chef。我需要版本11.4.2,它不是最新的。最近的一次对我不起作用。我去了

http://www.opscode.com/chef/install/
下载并安装:

chef-client-11.4.2-1.windows.msi

在做了“流浪者毁灭”之后,它就起了作用,接着又做了“流浪者行动”。

亚当,对不起,我是流浪者和厨师的新手。你能解释一下把你包含的代码放在哪里吗?我只是想运行的虚拟机中讨论的议案。。。文章(漏了一个字)我只是把问题和文章一起重读了一遍,我的建议对于解决你的问题并不是那么容易。你可以1)获得一个具有升级版Chef的VM(你不必运行内联Chef升级)2)如果你不需要它,不要升级Chef,或者3)以另一种方式升级Chef->将升级放在烹饪书中,你可以在这个新的烹饪书中添加你需要的任何缺少的软件包。最简单的选择是#2,但如果您确实需要升级的Chef版本,则很容易适得其反。如果你有时间的话,我建议你对Chef&Vagrant再深入一点。