我正在尝试使用Chef-solo为RVM设置一本食谱。
我的run_list看起来像:
"run_list": [ "recipe[apt]", "recipe[build-essential]", "recipe[curl]", "recipe[users]", "recipe[rvm::vagrant]", "recipe[rvm::system]", "recipe[nginx::passenger]", "recipe[nginx::source]", "recipe[postgresql::server]", "recipe[postgresql::client]" ]
我对RVM和Nginx的属性:
"rvm": { "rubies": ["1.9.3-p0"], "global": ["1.9.3-p0"], "vagrant": { "system_chef_solo" : "/opt/ruby/bin/chef-solo" }, "gems": { "1.9.3-p0": [ {"name": "bundler"}, {"name": "passenger"}, {"name": "rake"} ] } }, "nginx": { "version": "1.2.5", "user": "deploy", "init_style": "init", "modules": [ "http_stub_status_module", "http_ssl_module", "http_gzip_static_module" ], "passenger": { "version": "3.0.18" }, "configure_flags": [ "--add-module=/var/lib/gems/1.9.1/gems/passenger-3.0.18/ext/nginx" ], "gzip_types": [ "text/plain", "text/html", "text/css", "text/xml", "text/javascript", "application/json", "application/x-javascript", "application/xml", "application/xml+rss" ] },
然而,转换中断了:
================================================================================ Error executing action `install` on resource 'gem_package[passenger]' ================================================================================ Gem::InstallError ----------------- passenger requires rake (>= 0.8.1) Resource Declaration: --------------------- # In /tmp/vagrant-chef-1/chef-solo-1/cookbooks/nginx/recipes/passenger.rb 53: gem_package 'passenger' do 54: action :install 55: version node["nginx"]["passenger"]["version"] 56: gem_binary node["nginx"]["passenger"]["gem_binary"] if node["nginx"]["passenger"]["gem_binary"] 57: end 58: Compiled Resource: ------------------ # Declared in /tmp/vagrant-chef-1/chef-solo-1/cookbooks/nginx/recipes/passenger.rb:53:in `from_file' gem_package("passenger") do version "3.0.18" package_name "passenger" provider Chef::Provider::Package::Rubygems retry_delay 2 action [:install] retries 0 recipe_name "passenger" cookbook_name :nginx end .... /opt/ruby/lib/ruby/gems/1.8/gems/chef-10.18.2/bin/../lib/chef/application/solo.rb:216:in `run_application' /opt/ruby/lib/ruby/gems/1.8/gems/chef-10.18.2/bin/../lib/chef/application.rb:72:in `run' /opt/ruby/lib/ruby/gems/1.8/gems/chef-10.18.2/bin/chef-solo:25 /opt/ruby/bin/chef-solo:19:in `load' /opt/ruby/bin/chef-solo:19 [2013-02-26T14:22:18+00:00] FATAL: Gem::InstallError: gem_package[passenger] (nginx::passenger line 53) had an error: Gem::InstallError: passenger requires rake (>= 0.8.1) Chef never successfully completed! Any errors should be visible in the output above. Please fix your recipes so that they properly complete.
可以做些什么?
答案 0 :(得分:5)
这是一个写作指南,使用厨师https://coderwall.com/p/r4lv7w
与乘客一起安装nginx答案 1 :(得分:1)
Nginx需要从源代码编译,而Apache可以使用Passenger模块。这意味着,Nginx需要知道RVM gem中Passenger扩展的来源。
使用
覆盖:gem_binary
"passenger": { "version": "3.0.18", "gem_binary": "/usr/local/rvm/wrappers/ruby-1.9.3-p0/gem" },
应该这样做。