Application cookbook, ruby 1.9, rails 3.1.0, mysql gem not getting installed?


#1

Any assistance would be appreciated–I’m sort of at a loss at this point.

I’ve been doing some hacking on chef and the application cookbook (following
some good write-ups people have posted on their blogs) and have an EC2 node
that comes up with ruby 1.9, chef 0.10, rails 3.1.0, etc.

All seems good except that the mysql gem is not getting installed (or not
getting installed early enough?) and so the process fails when the database
master role tries to create the database, for which it is apparently using
the mysql gem (specifically: “INFO: Processing mysql_database[create
zmx_staging] action create_db (database::master line 84)”).

I check at that point and no, there is no mysql gem. If I install the gem
manually and then run chef-client, the configuration continues and succeeds.

As far as I can tell, I shouldn’t have to be specifying any of the mysql
recipes in any of my roles files, nor include the gem in the gems list of
the apps data bag (since that shouldn’t apply until later).

Suggestions? More info I can provide?

Thanks…

dwh


#2

Hello,

On Sep 5, 2011, at 11:39 PM, Denis Haskin wrote:

All seems good except that the mysql gem is not getting installed (or not
getting installed early enough?) and so the process fails when the database
master role tries to create the database, for which it is apparently using
the mysql gem (specifically: “INFO: Processing mysql_database[create
zmx_staging] action create_db (database::master line 84)”).

The mysql::client recipe that handles installing the MySQL ruby libraries will install them as a package on debian/ubuntu and redhat-family distros. We should probably make it a gem installation on all platforms because of this particular issue.

To fix, you can replace the if block from line 43-61[0] in the mysql::client recipe with:

gem_package “mysql” do
action :install
end

[0]: in version 1.2.0, the current release on community.opscode.com.


Opscode, Inc
Joshua Timberman, Director of Training and Services
IRC, Skype, Twitter, Github: jtimberman


#3

Ah, I thought maybe it was something along those lines, and was poking
around that file. I wasn’t fully understanding it yet, though.
Thanks–I’ll give this a try.

dwh

On Tue, Sep 6, 2011 at 2:29 PM, Joshua Timberman joshua@opscode.com wrote:

Hello,

On Sep 5, 2011, at 11:39 PM, Denis Haskin wrote:

All seems good except that the mysql gem is not getting installed (or
not
getting installed early enough?) and so the process fails when the
database
master role tries to create the database, for which it is apparently
using
the mysql gem (specifically: “INFO: Processing mysql_database[create
zmx_staging] action create_db (database::master line 84)”).

The mysql::client recipe that handles installing the MySQL ruby libraries
will install them as a package on debian/ubuntu and redhat-family distros.
We should probably make it a gem installation on all platforms because of
this particular issue.

To fix, you can replace the if block from line 43-61[0] in the
mysql::client recipe with:

gem_package “mysql” do
action :install
end

[0]: in version 1.2.0, the current release on community.opscode.com.


Opscode, Inc
Joshua Timberman, Director of Training and Services
IRC, Skype, Twitter, Github: jtimberman