我正在使用 Vagrant 在本地创建开发服务器。我正在编写自己的厨师食谱来安装我需要的一切,但我遇到了问题。
Pear 无法安装,因为我认为它正在尝试下载不稳定的版本。错误是:
No such file or directory - pear -d preferred_state=stable search PEAR
配方如下
#
# Chef recipe for provisioning a LAMP
# development server.
#
require_recipe 'apt'
require_recipe 'apache2'
require_recipe 'apache2::mod_php5'
require_recipe 'php::module_gd'
require_recipe 'mysql::server'
php_pear "PEAR" do
action :upgrade
end
php_pear "MDB2" do
action :install
end
php_pear "MDB2#mysql" do
action :install
end
# Grant access to this box...
ruby_block "Create database + execute grants" do
block do
require 'rubygems'
Gem.clear_paths
require 'mysql'
m = Mysql.new('localhost', "root", node[:mysql][:server_root_password])
m.query("GRANT ALL ON *.* TO 'root'@'10.0.0.1' IDENTIFIED BY '#{node[:mysql][:server_root_password]}'")
m.query('FLUSH PRIVILEGES')
end
end
如何让 PEAR 安装最新的稳定版本?