通过ruby_build&和图书管理员 - 厨师安装红宝石的流浪汉rbenv

时间:2013-05-23 14:39:12

标签: ruby chef vagrant rbenv

在过去的几周里,我不得不重新安装我的整个工作环境几次,这可能需要一段时间,所以现在我有一个雄心勃勃的想法,使用流浪汉和图书管理员厨师创造我的工作环境,以便所有我拥有要做的就是运行一个bash脚本和我所在的中提琴。

所以我第一次这样做是独自流浪汉我进去做了所有的事情并打包了它只是一段时间很棒..包装是600mb所以下一个想法是让厨师做到这一切。但我之前从未和厨师合作过,所以我发现librarian-chef基本上是我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

时,你告诉流浪汉和厨师建立这些 中的

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我发现这个question似乎有答案但我得到以下

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构建安装ruby是否有可能或者这是不可能的

2 个答案:

答案 0 :(得分:0)

图书管理员将在本地安装您的食谱,但不会将它们转移到远程流浪者盒中。您需要使用Vagrant Librarian Chef plugin

另见:

答案 1 :(得分:0)

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

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