- From: Xabier de Zuazo <
>
- To:
- Subject: [chef] Re: mysql cookbook database creation problem: cannot load such file -- mysql2
- Date: Mon, 16 Feb 2015 01:05:46 +0100
Hi Anthony,
On Mon, Feb 16, 2015 at 07:30:59AM +1100, Anthony Kong wrote:
>
It is my cookbook
>
>
mysql_service 'default' do
>
bind_address '0.0.0.0'
>
initial_root_password 'password'
>
action [:create, :start]
>
end
>
>
# Create a mysql database
>
mysql_database 'zeetings' do
>
connection(
>
:host => '127.0.0.1',
>
:username => 'data',
>
:password => 'password'
>
)
>
action :create
>
end
>
>
It is what I get when I run `kitchen converge`
>
>
LoadError
>
---------
>
cannot load such file -- mysql2
>
>
Did I miss some steps here?
Since database cookbook version 4, you must install the mysql2 gem by
yourself:
mysql2_chef_gem 'default' do
action :install
end
mysql_database 'zeetings' do
# [...]
end
And include the `mysql2_chef_gem` cookbook dependency in your metadata.rb.
From
https://github.com/opscode-cookbooks/database#resourcesproviders:
MySQL: leverages the mysql2 gem, which can be installed with the
mysql2_chef_gem resource prior to use (available on the Supermarket). You
must depend on the mysql2_chef_gem cookbook, then use a mysql2_chef_gem
resource to install it. The resource allows the user to select MySQL
client
library versions, as well as optionally select MariaDB libraries.
Regards,
--
Xabier de Zuazo
Attachment:
signature.asc
Description: Digital signature
Archive powered by MHonArc 2.6.16.