繁体   English   中英

流浪者与图书管理员通过ruby_build和rbenv安装ruby

[英]Vagrant with librarian-chef installing ruby via ruby_build & rbenv

在过去的几周中,我不得不重新安装整个工作环境几次,这可能需要一段时间,所以现在我有了一个雄心勃勃的想法,即使用无业游民和图书馆管理员来创建我的工作环境,因此我要做的就是运行bash脚本,然后我进入中提琴。

所以我第一次做这件事是无所事事,我进了所有的东西并将其包装,这很棒,只用了一段时间。.包装是600mb,所以下一个想法是让厨师来做。 但我之前从未与厨师合作过,所以我发现图书管理员主要是我的librarian-chef init ,它使Cheffile可以指定食谱,我的看起来像这样

site 'http://community.opscode.com/api/v1'

cookbook 'apt'
cookbook 'git'
cookbook 'build-essential'
cookbook 'ruby_build',
  git: 'git://github.com/fnichol/chef-ruby_build'
cookbook 'rbenv',
  git: 'git://github.com/fnichol/chef-rbenv'
cookbook 'sqlite',
  git: 'git://github.com/opscode-cookbooks/sqlite.git'
cookbook 'nodejs',
  git: 'http://github.com/mdxp/nodejs-cookbook'
cookbook 'mysql',
  git: 'git://github.com/opscode-cookbooks/mysql.git'
cookbook 'redis',
  git: 'git://github.com/brianbianco/redisio.git'
cookbook 'zlib',
  git: 'git://github.com/opscode-cookbooks/zlib'
cookbook 'wkhtmltopdf',
  git: 'git://github.com/firstbanco/chef-wkhtmltopdf.git'

当你打电话给vagrent up时,你告诉vagrant和厨师来构建这些

在vagrantfile中

config.vm.provision :chef_solo do |chef|
  chef.cookbooks_path = ["cookbooks","site-cookbooks"]
  chef.add_recipe "apt"
  chef.add_recipe "build-essential"
  chef.add_recipe "git"
  chef.add_recipe "ruby_build"
  chef.add_recipe "rbenv::install"
  chef.add_recipe "sqlite"
  chef.add_recipe "nodejs"
  chef.add_recipe "mysql"
  chef.add_recipe "redis"
  chef.add_recipe "zlib"
  chef.add_recipe "wkhtmltopdf"
end

现在我想知道是否可以让ruby_build安装1.9.3-p290我发现这个问题似乎有答案,但我得到以下

Running chef-solo...
stdin: is not a tty
[2013-05-23T14:31:18+00:00] INFO: *** Chef 10.14.2 ***
[2013-05-23T14:31:18+00:00] INFO: Setting the run_list to ["recipe[apt]", "recipe[build-essential]", "recipe[git]", "recipe[ruby_build]", "recipe[rbenv::install]", "recipe[sqlite]", "recipe[nodejs]", "recipe[mysql]", "recipe[redis]", "recipe[zlib]", "recipe[wkhtmltopdf]"] from JSON
[2013-05-23T14:31:18+00:00] INFO: Run List is [recipe[apt], recipe[build-essential], recipe[git], recipe[ruby_build], recipe[rbenv::install], recipe[sqlite], recipe[nodejs], recipe[mysql], recipe[redis], recipe[zlib], recipe[wkhtmltopdf]]
[2013-05-23T14:31:18+00:00] INFO: Run List expands to [apt, build-essential, git, ruby_build, rbenv::install, sqlite, nodejs, mysql, redis, zlib, wkhtmltopdf]
[2013-05-23T14:31:18+00:00] INFO: Starting Chef Run for precise64
[2013-05-23T14:31:18+00:00] INFO: Running start handlers
[2013-05-23T14:31:18+00:00] INFO: Start handlers complete.

================================================================================
Recipe Compile Error
================================================================================

Chef::Exceptions::RecipeNotFound
--------------------------------
could not find recipe ruby_build for cookbook rbenv

[2013-05-23T14:31:19+00:00] ERROR: Running exception handlers
[2013-05-23T14:31:19+00:00] ERROR: Exception handlers complete
[2013-05-23T14:31:19+00:00] FATAL: Stacktrace dumped to /tmp/vagrant-chef-1/chef-stacktrace.out
[2013-05-23T14:31:19+00:00] FATAL: Chef::Exceptions::RecipeNotFound: could not find recipe ruby_build for cookbook rbenv
Chef never successfully completed! Any errors should be visible in the
output above. Please fix your recipes so that they properly complete.

我如何通过ruby build来安装ruby,这是可能的还是不可能的?

图书管理员将在本地安装您的食谱,但不会将其转移到远程无用信息盒中。 您需要使用Vagrant Librarian Chef插件

也可以看看:

尝试将ruby_build添加到运行列表:

"run_list": [ "ruby_build", "recipe[main]" ]

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM