使用 vagrant 的厨师食谱安装 PEAR 时出现问题
我正在使用 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 安装最新的稳定版本?
I am using Vagrant to create a development server locally. I am writing my own Chef recipe to install everything I need but I am running into problems.
Pear will not install as I think it is trying to pull down a version that is not stable. The error is:
No such file or directory - pear -d preferred_state=stable search PEAR
The recipe is as follows
#
# 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
How can I make PEAR install the last stable version?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您正在使用 pear 来安装 pear 本身吗?这不奇怪吗?
该错误消息
表明您的配方尝试将完整命令用作一个可执行文件,而不是作为命令和参数。
You are using pear to install pear itself? Isn't that strange?
The error message
indicates that your recipe tries to use the full command as one executable, not as command and parameters.
以下是我在 Ubuntu VM 中升级 PEAR 的操作:
有一个名为
php-pear
的 Ubuntu 软件包,因此此命令将安装最新版本Here's what I'm doing to upgrade PEAR in my Ubuntu VM:
There's an Ubuntu package called
php-pear
, so this command will install the latest version