首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何修复拼音错误: sh: 1: make:未找到

如何修复拼音错误: sh: 1: make:未找到
EN

Stack Overflow用户
提问于 2013-06-15 08:14:59
回答 4查看 6.2K关注 0票数 2

我正在学习http://gettingstartedwithdjango.com/en/lessons/introduction-and-launch/的一个视频教程

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

我试着去找流浪汉然后得到了:

代码语言:javascript
复制
  $ 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

当我这样做的时候:

代码语言:javascript
复制
$ which make

我得到了:

代码语言:javascript
复制
/c/opscode/chef/embedded/bin/make

所以看起来make在filepath中

我该如何解决这个问题呢?

附录:当我将漫游文件编辑为:

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

我得到了:

代码语言:javascript
复制
/tmp/vagrant-shell: line 1: curl: command not found
EN

回答 4

Stack Overflow用户

发布于 2013-06-16 00:45:56

您正在使用的basebox默认情况下没有安装"build-essential“包,它有一个"shell provisioner”,可以将Chef gem安装到默认的Ruby环境中。Chef依赖于JSON RubyGem,而JSON本身具有必须编译的C扩展。这就是我们要找的make

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

代码语言:javascript
复制
config.vm.provision :shell, :inline => "curl -L https://opscode.com/chef/install.sh | bash"

或者,如果你的basebox没有curl,使用wget:

代码语言:javascript
复制
config.vm.provision :shell, :inline => "wget -O https://opscode.com/chef/install.sh | bash"

[install.sh][3]脚本只需检查VM以确定其平台,以便它可以从S3存储桶中检索适当的[install.sh][3]。如果您愿意,可以使用构造的URL直接下载.deb文件:

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

然后安装它:

代码语言:javascript
复制
dpkg -i chef_11.4.4-2.ubuntu.11.04_amd64.deb

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

票数 2
EN

Stack Overflow用户

发布于 2013-06-15 12:17:33

您是在哪台机器上运行which make的?(主机/来宾)。确保guest(virtualbox)有一个make

https://github.com/scottmuc/vagrant-postgresql/issues/1#issuecomment-7798110

票数 0
EN

Stack Overflow用户

发布于 2013-06-15 16:53:36

如果操作系统没有预装make,而你仍然想继续前进,你可以这样做:

代码语言:javascript
复制
e = package "make" do
        action :nothing
end

e.run_action(:install)

它将在编译时安装make包,在您的任何食谱尝试使用它之前。你应该把它放在你的食谱中,最好放在最上面,这样其他读者就能清楚地知道发生了什么。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/17119003

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档